Set default value of lookup Control using Jquery


Badge +1

I am trying to set up default value of list lookup control in Nintex 2016 Forms version 4.2 using Jquery.

I have tried below code but nothing happens on Nintex 2016.

NWF$("#" + drpdownid + " option:contains(" + valuetolookupandselect+")").attr("selected", true);

NWF$("#" + drpdownid).change();


3 replies

Badge +7
NWF.FormFiller.Events.RegisterAfterReady(function ()
{

NWF$('#' + drpdownid ).parent().find('select').find('option:contains("'+valuetolookupandselect+'")').attr("selected", true);

NWF$('#' + drpdownid ).parent().find('select').change();
});‍‍‍‍‍‍‍

Where valuetolookupandselect is option's text not value

And drpdownid is set as per the below picture:

Badge +10
It worked, Thanks, Was struggling with this on Nintex Forms 2.11.4.30
Badge +1

Hi does this work on Chrome / iPad?

I have a similar solution working on Windows/Chrome/IE but on iPad the default selection is blank on the drop down control.

Reply