This project has moved and is read-only. For the latest updates, please go here.

SPLookupAddNew not working

Nov 27, 2009 at 6:31 AM
Edited Nov 28, 2009 at 1:45 PM

I downloaded 4.5, customized the forms, and on my test server everything worked perfectly (except it doesn't seem to work for lookup fields with multiple values).  Then I did the same thing on my production server, and nothing happens.  I've triple-checked and copied the code from test to production.  The new custom forms are called (I checked the URL), and they appear fine.  No error messages, and I have debug turned on.  But the Add New link doesn't appear.  View source didn't help, so I have no idea why it worked in test but not in production.

I'll try 4.6 and see if that makes a difference, but any idea what could be causing this?  Is it maybe the more than 20 items in the list issue?  The data is the only difference between servers.


Nov 28, 2009 at 1:45 PM

I tried 4.6, and it's the same.  I also looked into the 20 items plus issue, and that's not it either.  Any ideas on what else I can check?

Nov 29, 2009 at 12:28 AM

Nevermind - I fixed it.  It was a context/URL issue.

Nov 30, 2009 at 2:28 AM

Glad you got it sorted out. Let me know if you have more questions.


Mar 17, 2010 at 11:15 AM

I want to turn back to "lookup fields with multiple values" issue.

Now (0.5.2) it is not work, but original script (  works now with multiple values, but do not work with 20+ items.

Any chance unification ? :)

may be you have any suggestions how to fix any of scripts (yours or Waldek Mastykarz) to work in all 3 states (single value, less than 20 items; single value, more than 20 items; miltiple values)


Mar 17, 2010 at 1:45 PM


I'm not sure I understand your question. SPLookupAddNew should work fine in all three cases, as long as the column is a Lookup column.


Mar 17, 2010 at 6:38 PM


I saw your comment over on Waldek's post.  My SPLookupAddNew should work better than his solution, only because I expanded on his original idea.  If you have a specific problem, let me know and we'll work it through. When you did your original post above, I tested, and SPLookupAddNew works with all three types of columns.


Mar 18, 2010 at 9:13 AM

I still can't make SPLookupAddNew to work as expected:

when i have list with 5 elements, Waldeks's solution works well, but when i add more than 100 elements, solution stop working. as far as i can see, this is because ExtendedLookupFields.ascx can't find "select" field type, it is now simulated by "text" type field.

then I try your solution, it work well until i set "multiple values" switch.

now it show debug window "column not found in page". Then I try to change DisplayName to latin (i use cyrillic names) - no chance

now I try to create new clumn with latin name, all work ok. then i select "multiple" in column properties - again debug window "column not found"

may be you tell me which html attribute used for displayname ? now i see "<... title='singleValueLookupField' ...>" but when i select multivalue i don't see the "<... title='multiValueLookupField' ...>"


 btw, Wakdek's square dot before link look pretty cool :-)


Mar 18, 2010 at 12:49 PM

Can you post the code you're trying? Also, what version of my library are you using? The latest release (v0.5.2) contains a fix for foreign language sites with SPCascadeDropdowns.

If you provide more information, it's easier to help. ;=)


Mar 18, 2010 at 4:07 PM
Edited Mar 18, 2010 at 4:09 PM
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<script type="text/javascript" language="javascript" src="/SystemLibrary/jquery-1.4.2.min.js"></script>
<script type="text/javascript" language="javascript" src="/SystemLibrary/jquery.SPServices-0.5.2.min.js"></script>
<script type="text/javascript">
$(document).ready(function() {
		lookupColumn: "Исполнитель",
		promptText: "Добавить нового исполнителя",
		completefunc: null,
		debug: true
		lookupColumn: "DUDUDU",
		promptText: "Добавить нового {0}",
		completefunc: null,
		debug: true
1'st lookup(Исполнитель) - single valued lookup, second(DUDUDU) - miltivalued
here it is screenshots for both single valued and DUDUDU - multivalued
Now I have enabled both your code and Waldek's but this is not case. when Waldek's disabled your still do not work

Mar 18, 2010 at 4:26 PM

Can you send me a View Source of the page?  I think it's probably a language setting thing.


Mar 19, 2010 at 12:36 PM
Edited Mar 19, 2010 at 12:43 PM


Thiese are the relevant pieces on the page from what you sent in email..  I'll need a little help with translation!

<select name="ctl00$m$g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2$ctl00$ctl04$ctl08$ctl00$ctl00$ctl04$ctl00$ctl00$SelectCandidate" id="ctl00_m_g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_SelectCandidate" multiple="multiple" title="Возможных значений: DUDUDU" onchange="GipSelectCandidateItems(ctl00_m_g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);" ondblclick="GipAddSelectedItems(ctl00_m_g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false" onKeyDown="GipHandleHScroll(event)">

<select name="ctl00$m$g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2$ctl00$ctl04$ctl08$ctl00$ctl00$ctl04$ctl00$ctl00$SelectResult" id="ctl00_m_g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_SelectResult" multiple="multiple" title="Выбранных значений: DUDUDU" onchange="GipSelectResultItems(ctl00_m_g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m);" ondblclick="GipRemoveSelectedItems(ctl00_m_g_d8afd969_88f9_4181_9f0e_7d21d6e75ca2_ctl00_ctl04_ctl08_ctl00_ctl00_ctl04_ctl00_ctl00_MultiLookupPicker_m); return false" onKeyDown="GipHandleHScroll(event)">

<input type="text" value="667" /><input id="syn_ctrl667" type="text" value="-" />

On an English site, this would read: 'DUDUDU possible values' and 'DUDUDU selected values'.


Mar 19, 2010 at 3:04 PM

yes, you a right

Mar 19, 2010 at 4:17 PM


Возможных значений: DUDUDU is equivalent to 'DUDUDU possible values'
Выбранных значений: DUDUDU is equivalent to 'DUDUDU selected values'

Is that correct? It would be helpful if you could tell me the actual translation of the Russian (or whatever it is!).

I put a fix into v0.5.2 that fixed things for non-English sites, but obviously it doesn't work where the Title follows a different construct.  I'll have to look into a new fix.


Mar 19, 2010 at 4:19 PM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.