AnsweredAssumed Answered

JavaScript don't load on Edit Mode

Question asked by ejagkrch on Jun 17, 2015
Latest reply on Jun 18, 2015 by ejagkrch

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.

Outcomes