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

Form field with formatted text different from its value

nepomucenobr
Registered: Jul 27 2010
Posts: 10
Answered

Hi everyone,
 
I have a form field with a date format (mm/dd/yyyy). The thing is the value is different from what is been presented. For example, let's say I type june 15. After I hit tab it will present "06/15/2010" but if check the value of the field, it will be "june 15".
 
How can I get the formatted text? I was thinking about changing the value of the field to this formatted text on "on blur" event. Do you think it's a good idea?
 
Thank you!

My Product Information:
Acrobat, Windows
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
You can use the "Validation" script to force the formatting.

if (event.value != '')
event.value = util.printd('mm/d/yyyy', util.scand('mm/dd/yyyy', event.value))


George Kaiser

nepomucenobr
Registered: Jul 27 2010
Posts: 10
It works! Thank you very much!