I'm trying to understand this but for some reason I can't. I'm fairly new to Javascript....
Here is what I want to do.
var companyList = {};
companyList.comanyZero = {
fldStreet: "That street 0",
fldPostcode: "0000 AA",
fldCity: "Amsterdam",
fldCountry: "The Netherlands"
};
companyList.companyOne = {
fldStreet: "Street name 1",
fldPostcode: "1234 BA",
fldCity: "Amsterdam",
fldCountry: "The Netherlands"
};
if (!event.willCommit){
if (event.changeEx === "companyZero"){
this.getField("fldStreet").value = companyList.companyZero.fldStraat;
this.getField("fldPostcode").value = companyList.companyZero.fldPostcode;
this.getField("fldCity").value = companyList.companyZero.fldCity;
this.getField("fldCountry").value = companyList.companyZero.fldCountry;
}
if (event.changeEx === "companyOne"){
this.getField("fldStreet").value = companyList.companyOne.fldStreet;
this.getField("fldPostcode").value = companyList.companyOne.fldPostcode;
this.getField("fldCity").value = companyList.companyOne.fldCity;
this.getField("fldCountry").value = companyList.companyOne.fldCountry;
}
}
The idea is to create a loop that gives back the values according to what is selected in my combobox.
Please note that this is a PDF moderation so users can change a combobox in a PDF and the fields will be filled with correct data.