Autopopulate question
I have a document with 48 drop down lists (same info on each). The dropdown lists are each named individually (PayTypeDesc Job1Emp1, PayTypeDesc Job1 Emp2, PayType Job1Emp3 etc.) I would like each dropdown list to autopopulate to a separate table below where I named each text field PayType Job1Emp1, PayType Job1Emp2, PayType Job1 Emp3 etc. For example, dropdown list named PayType Job1Emp1 will autopopulate to field named PayType Job1Emp1, then dropdown list named PayType Job1Emp2 will autopoulate to Job1Emp2 etc.
When I entered the following script it worked on the first line but it didn’t work on the second one and I have another 47 to go, I just can’t seem to figure out how to make each one do it’s own individual purpose. Do I have to give each one a different Script Name and if so what do I name it?
I followed what is on this website which is how I got the script below https://acrobatusers.com/tutorials/change_another_field
Under dropdown Properties I select ‘Commit Selected Value Immediately’ then I custom enter under format on the Custom Keystroke Event I enter the following code:
if( event.willCommit )
{
if(event.value == " ")
this.resetForm(["PayType Job1Emp1"]);
else
SetFieldValues(event.value);
}
Under document javascripts I give the Script Name ‘SetFieldValues” then enter:
// Place all prepopulation data into a single data structure
var DeptData = { Regular:{ PayType: "1" },
Temp:{ PayType: "2" },
Acting :{ PayType: "11" },
Auxiliary:{ PayType: "3" },
COT:{ PayType: "263" },
POT:{ PayType: "266" },
Vacation:{ PayType: "300" },
Sick:{PayType: "400" }};
function SetFieldValues(cDeptName)
{
this.getField("PayType Job1Emp1").value = DeptData[cDeptName].PayType;
