Currently using this script in a combo box:
var ITEMS = [[" ", ""], ["ABC"], ["DEF"], ["HIJ"], ["KLM"]];
var DETAILS = [[" ", ""], [123], ["456"], ["789"], ["101112"], ["GO BACK..."];
{
if(event.value == "GO BACK..."){ event.target.setItems(ITEMS)}
if(event.value == "ITEMS") { event.target.setItems(DETAILS);}
}
This works great for what I need.
However, is it possible to also combine the script that @Thom Parker developed :"Using a Combo Box to Pre-populate Form Fields"??
For example
// Place all prepopulation data into a single data structure
var DeptData = { "123":{ contact: "Steala Damuni",
email: "accounting@mycomp.com",
deptnum: "cmp1234" },
"456":{ contact: "Frank N. Stien",
email: "engineering@mycomp.com",
deptnum: "eng1234" },
"789" :{ contact: "Shelly Oughtbuks",
email: "marketing@mycomp.com",
deptnum: "mkt1234" },
"101112":{ 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;
}
I woud like to, somehow, have this second script fill out various text fields once the user selects the second option:
if(event.value == "ITEMS") { event.target.setItems(DETAILS);} from that same dropdown menu.
It seems like is not possible.
But I am wondering if upon the combobox populating items when the user selectes this: if(event.value == "ITEMS") { event.target.setItems(DETAILS);} if that that script can somehow be combined to achieve filling out other texfields employing a single data structure approach.
Is this possible at all?
Could it be this part [" ", ""] ?
I can't figure out how to make these two scripts work together.
Thanks for any help with this.
... View more