SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

How can i set the value of sharepoint form field dropdown box(lookupfield) in sharepoint list form when the form gets saved (using jquery) note: the lookupfield (dropdown formfield renders as input if it contains values more than 20)

share|improve this question
up vote 2 down vote accepted

I just implemented such a solution a couple of weeks ago

Here is a very good post that will explain all.

share|improve this answer

So I have a field called "Data Classification":

var dataClsField = $('select[title="Data Classification"]');

I was trying to set this field with the value of another dropdown called "DataClass" that I got using this code:

var clsFieldValue = $('select[id*="DataClass"] option:selected').val();

For some crazy reason, I had to do both of these options to get my first field to set right:

dataClsField.find('option[value="'+clsFieldValue+'"]').prop('selected', true);

Note: This was with 2 dropdowns with less than 20 items in each. I believe the only difference, jQuery-wise, when it goes over that, is that "select" becomes "input" on your selector.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.