AutoPopulate Field from drop down selection

riaz_mansuri
Kilo Guru

Hi,

I am trying to Auto Populate a field when a selection is a made from a drop down using client script.

My script which does not work is below. Any help would be appreciated.

So When "Risk Type" Corporate is selected the "Internal ref" should Auto Populate to CO000

Risk Strat.JPG

function onChange(control, oldValue, newValue, isLoading) {    

  if (isLoading || newValue == '') {    

          return;    

  }    

 

  var svc = g_form.getReference('Corporate');    

  g_form.setValue('SR000', internal_ref);        

}    

Thanks

1 ACCEPTED SOLUTION

function onChange(control, oldValue, newValue, isLoading, isTemplate) {


    if (isLoading || newValue == '') {


          return;


    }


var svc= g_form.getValue("u_risk_type");


alert('Outside'+svc);


if (svc == "Corporate") {


alert('Inside');


g_form.setValue("u_internal_ref", "CO000");


}


}


View solution in original post

21 REPLIES 21

Hiyah,



I am Really sorry but your script worked fine, I am going to mark it as Correct.



I just realised with your last comment that I did not have it as Active.



Thank You so much,


Riaz


THANKS FOR CLARIFYING,IT REALLY HELPED!