AnsweredAssumed Answered

Set a Lookup field by javascript

Question asked by jackgelo Expert on Mar 31, 2016
Latest reply on Apr 13, 2018 by marekan

Hi,

 

I'm using Nintex Forms 2013 on an-premises environment and I'm finding some issues while I try to set a Lookup field using javascript.

 

In my form I have a button who calls a javascript function where I do my stuff to get the value to be selected in the lookup field and then I'm ready to set the field.

The field has a css class "geoArea".

 

I've tried the following lines of code

NWF$('.geoArea select option[title="My option title"]').prop("selected",true);

NWF$('.geoArea select').val(optValue); //optValue is a variable with the numeric value of the option I want to select

 

With both lines I'm able to apparently set to field to the value I want but when I save the form, the value is lost, so if I open it again the field is blank again.

If I select the value manually in the field, the value is save correctly.

Do you know if is there anything else I have to set to save my value when I save the form?

 

Thanks!!

Giacomo

Outcomes