This is my first post on this forum. I have tried to figure this out on my own, but no solution.
I am creating a PDF with LiveCycle Designer ES v 8.2. and trying to a show state dropdown list if US is selected and province dropdown list if Canada is selected using an "if, else if" statement.
My form opens with both dropdown lists hidden and I want to show a picklist only if United States or Canada is chosen.
Here is my script for when the Country is chosen from the dropdown box. Can anyone figure out what is happening? The dropdown list field names are:
cboCo_Name_Country
cboCo_Name_State
cboCo_Name_ProvinceI
PROBLEM: No matter which country I choose, it always go to the final else statement where both are hidden. I know this because in trouble-shooting I made combo boxes initially visible and no matter what country I chose, both fields became hidden.
form1.sf_Page_1.sf_CompInfo.sf_CustAddress.cboCo_Name_Country::change - (JavaScript, client)
// Change the presence attribute of the state and province fields.
if (this.rawValue == "United States") { // If country selected is US,
cboCo_Name_State.presence = "visible"; // show US States field,
cboCo_Name_Province.presence = "hidden"; // and hide Provinces field.
}
else if (this.rawValue == "Canada") { // If country selected is Canada,
cboCo_Name_Province.presence = "visible"; // show Provinces field,
cboCo_Name_State.presence = "hidden"; // and hide US States field.
}
else { // Otherwise, if any other country is selected
cboCo_Name_State.presence = "hidden"; // hide US States field,
cboCo_Name_Province.presence = "hidden"; // and hide Provinces field.
}
Any help is appreciated.