Accented characters in variables
I'm doing a Spanish language form that displays a list of countries in a drop-down:
Seleccione el País
Colombia
Costa Rica
México
Panamá
Perú
The country name is is used to display different options. This worked as expected when the list of country names was in the dropdown validation box. But then I had to move the validation to a document-level script and now the validation doesn't work on any variable that has an accent in it. (Only Colombia and Costa Rica work as expected). So I added the following to the dropdown validation to try passing unaccented values to the document-level script:
var dropdown = event.value;
if (dropdown == "Seleccione el País"){
var resetDropdown = "Seleccione el Pais";
}else if (dropdown == "Colombia"){
var resetDropdown = "Colombia";
}else if (dropdown == "Costa Rica"){
var resetDropdown = "Costa Rica";
}else if (dropdown == "Panamá"){
var resetDropdown = "Panama";
}else if (dropdown == "Perú"){
var resetDropdown = "Peru";
}else{
var resetDropdown = "Mexico";
}
SetCountry(resetDropdown);
But the accents seem invisible to Acrobat Javascript. Accented dropdown names are not set as unaccented variable values, so Mexico becomes the variable value for the accented name.
In HTML JavaScript, I can set the value and the display text independently, but I can't see any way of doing that in Acrobat. Thanks for any ideas or hints.
