Not applicable

JavaScript don't load on Edit Mode

Jump to solution

I have a script that load values in the input field from the Lookup list. script run fine in the New\Display mode, but when I open the submitted item in the Edit mode, it trigger the lookup fields values to load again and that makes the input field values to disappear. when I go to the lookup menu and select different choice than it display the value again in the input field and than I have to change the choice again to display the value in the input field that was there.

 

NWF$( ".LookupfieldControl" ).change(function() {

var SelectedLookupChoice = NWF$("#" + Lookupfield).val();

 

NWF$("#" + SecondLookup ).val(SelectedLookupChoice);

var SelectedSecondLookup = NWF$("#" + SecondLookup).find(":selected").text();

NWF$("#" + Inputfield).val(SelectedSecondLookup);

 

});

 

 

I have two columns in the custom list, and using that list as a lookuplist in the second custom list that have the form, what I need is the value from second column into a input text field based on the selection of the first lookuplist, and the way I'm doing this is in JavaScript, selecting the lookfield choice, it sets the same row value on the second lookuplist and extract that text from second lookup list and add that text into the input field.

 

Thanks.

0 Kudos
Reply
2 Replies
pfudala
Nintex Newbie

Re: JavaScript don't load on Edit Mode

Jump to solution

Hi Sal,

 

Do you really need to put the second value into an input field?

I mean, is this second value may be modified by the user in the text field?

 

If you just need this value to perform a calculation (for example), you could do this without JavaScript.

Use a calculated value control and in the formula, use the runtime function "lookup()" using as filter the value of your first lookup field.

runtimeLookup.png

View solution in original post

0 Kudos
Reply
Not applicable

Re: JavaScript don't load on Edit Mode

Jump to solution

Yes, need of populate the value and user should be able to change it. But anyways  I was able to make my script working. I like your no code solution as well if I just wana display the value from second column. I didn't know that we can do this.

Thanks,

-Salman

0 Kudos
Reply