Set Lookup List Value with TextBox Value


Badge +9

I have list form that needs a few fields to be populated via SharePoint's Quick Edit feature. One of these fields is a country list lookup dropdown.

When the user inputs a country value in Quick Edit, they're populating a single line of text field. How can I set the value of the country list lookup with this textbox value when the form is brought up in Edit mode?

Any JavaScript would be appreciated. This is somewhat tricky because as we know, the list lookup values are not actual values...


2 replies

Userlevel 5
Badge +14

why not to direct users to select a value in lookup field? 

if you let them type in text value on their own they will definitely make mis-takes/types and you will get into troubles to identify proper value in lookup list.

if you insist on a javascript, it will highly depend on exact forms version you use, since lookup internal functionality and model is quite often changed. for the most recent version something like following should work

https://community.nintex.com/message/64742-re-set-default-value-to-lookup-field-stopped-working-after-nintex-forms-2013-… 

Badge +9

This is what I've done. For quick editing, data pasted goes directly into the lookup column field.

If using the actual form, the lookup field is connected to  a single line of text field, which via the following script, populates the lookup field each time the form is brought up:

var OfficeVal = NWF$('#' + OfficeSingleLineTextField).val();
NWF$('#' + OfficeLookupField + "option[value$= "+ OfficeVal +"]").prop("selected", true); 

Reply