Multiple Combo boxes using the same set of predetermined data.
My expertise in Java is -1, so complete newbie here.
I turned to this common link to learn about combo boxes: https://acrobatusers.com/tutorials/change_another_field/ and am slowly getting this to work on its own. Now my question, is it possible, using this code from the above link:
// Place all prepopulation data into a single data structure
var DeptData = { Accounting:{ contact: "Steala Damuni",
email: "accounting@mycomp.com",
deptnum: "cmp1234" },
Engineering:{ contact: "Frank N. Stien",
email: "engineering@mycomp.com",
deptnum: "eng1234" },
Marketing :{ contact: "Shelly Oughtbuks",
email: "marketing@mycomp.com",
deptnum: "mkt1234" },
ITSupport:{ contact: "Goah Wei",
email: "it@mycomp.com",
deptnum: "its1234" }};
function SetFieldValues(cDeptName)
{
this.getField("DeptContact").value = DeptData[cDeptName].contact;
this.getField("DeptEmail").value = DeptData[cDeptName].email;
this.getField("DeptNumber").value = DeptData[cDeptName].deptnum;
}
And repeat it within the same JavaScript? I figured out how to set the combo box to give me the values I want, but not to a separate combo box giving me different values. Example:
Combobox A (DeptData) is given a selection and autopopulates gives me output for Engineering
Combobox B (DeptData1) pulls from the same group of prefilled options and gives me output for Accounting.
Using two combo boxes, I can get two sets of data. I hope I'm making sense.
Otherwise, I'm making 150+ scripts, one for each possible selection with the same group of outputs.
Thank you,
Lahrs
