Text field entry for percentage needs Period (English) or comma (French) in JavaScript
I have a FRENCH fillable form, weather the person enters English 1.50 or 1,50 (comma French formatting), when they tab or enter the field the result should be a comma for French. Is there a way the result will be 1,50 whether it is entered as a period or comma?
Currently I have these scripts below if entering a period for English it will convert to comma for FRENCH but when entered as a comma the field becomes blank.
I need to be able to enter either/or in this field and have it convert to comma for FRENCH.
Custom format script
if (event.value !=="" && !isNaN(event.value)){
- event.value = util.printf("%,3.2f",event.value*100);
}else{
- event.value = "";
}
But nothing in the Custom keystroke script.
Validate tab, Run custom validate script
if (event.value !== "") {
- event.value = event.value / 100 ;
}
if (event.value>1||event.value<0)
{
- event.value="";
- app.alert("L’entrée doit être entre 0 et 100")
}
Thank you in advance! http://
