AnsweredAssumed Answered

How do I set the value of a List Lookup Control in script as if the user had made a selection manually?

Question asked by jeffckelly on Mar 26, 2018
Latest reply on Apr 3, 2018 by emha

In Nintex Forms for SharePoint 2013, I have a List Lookup Control that displays data from a List of reference items elsewhere in my SharePoint site. How can I set the selected value of this list using jQuery (such as that shown below) and make it seem to SharePoint as if the user has made the selection in the UI?

 

If I set the value of the List Lookup Control manually in the UI, the correct value is saved in my form item. However, if I set it with script, nothing is saved back to my form item. I know that there is some kind of magic going on in Nintex Forms when the user makes the selection manually, but I can't reproduce it with jQuery.

 

NWF$('.expenseType option').each(function() {

  if(NWF$(this).text().toLowerCase() == myExpenseType.toLowerCase()) {

     NWF$(this).attr('selected', 'selected');

     NWF$(.expenseType select').trigger('change');  

 }

});

 

Thanks for any suggestions or solutions!

Outcomes