Copy link to clipboard
Copied
Hi Guys,
Hope you can help. I have a drop down box (Dropdown21) which has multiple employment options in there. Employed, Self Employed, Retired and House Person. I am using a button to run a Javascript, the idea being that if you select Houseperson in the dropdown box it will populate another field (C2_House_Person) with the value 15000. If you select anything else then it will be 0. So far I have the following:-
var v1 = (this.getField("Dropdown21").valueAsString);
if (this.getField("Dropdown21").value=="a House Person") event.value = "15000";
this.getField("C2_House_Person").value = v1
Move this code to be the custom calculation script of "C2_House_Person" and change it to this:
var v1 = this.getField("Dropdown21").valueAsString;
if (v1=="a House Person") event.value = "15000";
else event.value = "0";
Make sure to set the properties of the drop-down to commit the selected value immediately (under Properties - Options), or it will only work when you exit that field.
Copy link to clipboard
Copied
Move this code to be the custom calculation script of "C2_House_Person" and change it to this:
var v1 = this.getField("Dropdown21").valueAsString;
if (v1=="a House Person") event.value = "15000";
else event.value = "0";
Make sure to set the properties of the drop-down to commit the selected value immediately (under Properties - Options), or it will only work when you exit that field.