SPComplexToSimpleDropdown in EditForm sets index to zero

Apr 9, 2013 at 6:01 PM
Hi Marc

The above is working great for me in a new form but when using it within an edit form the initial value always sets at 0 with the "Choose ..." prompt displayed. Because I already have a value set for the dropdown, that's the value I want to see. What am I doing wrong please?

Best, Des
Coordinator
Apr 10, 2013 at 1:31 PM
Des:

I'm not sure that you're doing anything wrong. It could be a bug.

Can you explain more about your column and show the code you are using?

M.
Apr 10, 2013 at 1:55 PM

Hi Marc

I've managed to work around the problem by grabbing the value on the way in and explicitly setting it after I've called the SPComplexToSimpleDrowdown function. I also noticed that if you don't change the value during the edit session then SharePoint doesn't save the value that you set explicitly (in IE anyway). I've worked around that by calling a trigger("change") function on the lookup column in question so that it manually calls the change event. That seems to have sorted it out.

But to answer the question the SPComplexToSimpleDrowdown function is called inside the document ready and after I've filtered the lookup with SPFilterDropdown.

Des Owen

Tel: +44 (0) 1492 593477

Mobile: +44 (0) 7515 955810

Coordinator
Apr 10, 2013 at 2:16 PM
Interesting. Did you try reversing the two calls?

M.
Apr 10, 2013 at 2:29 PM

Just tried that Marc and the same thing happens except that I get (None) rather than the Choose... option so I suspect the SPComplexToSimpleDropdown function doesn't like being called after the SPFilterDropdown function unless I'm missing something :-).

Des Owen

Tel: +44 (0) 1492 593477

Mobile: +44 (0) 7515 955810