These forums are now Read Only. If you have an Acrobat question, ask questions and get help from one of our experts.

Form Fields Number converting

briggsc
Registered: Feb 7 2008
Posts: 6

I have a form created in Adobe Acrobat Profess 8. In this form I have a text field. If my user enters a whole number like, "29"

I want the number to convert to a number that move the decimal place 2 spaces to the left, like ".29".

Do anyone have any suggestions or, can someone please help me?

My Product Information:
Acrobat Pro 8.1.1, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
The easiest way is to format the field as a number with 2 decimal places.

You can use the "isNaN()" and "Number()" functions to weed out nat a number and format a number string to a number and the following custom format script:

// if the event value is a number
if ( isNaN(event.value) == false )
event.value Number(event.value)/100; // format as a number and divide by 100

George Kaiser

briggsc
Registered: Feb 7 2008
Posts: 6
Where do I enter this formula? Should it go in the Format>Custom or Calculate>Calcualtion Script? I tried both areas, and its not working still. There's something Im doing wrong.if ( isNaN(event.value) == false ); event.value;
Number(event.value)/100;
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
First I would use the "number" format, it takes care of keystroke, validation, formatting and be done with it.

But since you want this option, on the "Format" tab select the "Custom" option and then click the "Edit" button next to the "Custom format" option and enter the script into the editor.

George Kaiser

briggsc
Registered: Feb 7 2008
Posts: 6
If I use the number format it doesn't have the option to make the number in that format, for example .30 . I use the custom option on the Format tab and entered

if ( isNaN(event.value) == false );
event.value;
Number(event.value)/100;

it didn't work. Am I entering this correctly? Thanks so much for your help!