Copy link to clipboard
Copied
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)){
}else{
}
But nothing in the Custom keystroke script.
Validate tab, Run custom validate script
if (event.value !== "") {
}
if (event.value>1||event.value<0)
{
}
Thank you in advance! http://
Copy link to clipboard
Copied
The easiest way would to format the field as a percentage and chose the "," separator. You may have to explain to the user about the use of the "," decimal point.
If you do not want to do then, then you will have to create a custom keystroke script to intercept and change the "," to a coma and then create a custom validation script to verify the use of the appropriate thousand separator and decimal point along with the custom format script for displaying the formatted result.
Copy link to clipboard
Copied
Unfortunately that doesn't work because it will give me % sign (which I don't need) and it will not allow me to use a period and convert it to comma. See first example.
I need to be able to insert a comma or period and end up with a comma (1,50). My scripts currently work as you can see the last two fields, I entered 1.5 and it converts to 1,5. But if I type 1,5 the field will become blank.
This could be filled out by a English or French speaking person but in the end I need it to be French, with a comma.
What I need is someone that can adjust my scripts below to accept a comma or period and convert to comma.
Maybe I need a Custom keystroke script??
FORMAT/CUSTOM
Custom format script
if (event.value !=="" && !isNaN(event.value)){
event.value = util.printf("%,3.2f",event.value*100);
}else{
event.value = "";
}
Custom keystroke script.
nothing here
Validate tab, Run custom validation 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")
}
Copy link to clipboard
Copied
Found this and it was very helpful. My problem is solved.