AnsweredAssumed Answered

How do I Set the Default Value for 2nd List Lookup?

Question asked by furstlars on Jan 3, 2018

How can I default a (cascading) second list lookup dropdown (RegionalCode) to always use its own first value regardless of what is selected in the first list lookup dropdown (CostCentre)? Can anyone help with the following script?

 

These 2 fields are used in a repeating section and may be entered multiple times.

 

NWF$(document).ready(function() {


var CostCentreDDL = NWF$('#' + CostCentre);


CostCentreDDL.change(function () {


var CostCentreValue = CostCentreDDL.val();
var CostCentreParsed = NWF.RuntimeFunctions.parseLookup(NWF$('#' + CostCentreValue,true));

 

if (CostCentreParsed == "3000" || CostCentreParsed =="4000" || CostCentreParsed == "5000") {

NWF$("#" + RegionalCode).val('1');

}

 

)}

});

Outcomes