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

Default Value in Field in Acrobat X

Nilea
Registered: May 17 2011
Posts: 3
Answered

I am using Acrobat X Pro for Mac. I have created a form and have a couple of fields where users can enter a number. When the form is first opened, there is a default value of 0 in the fields. If the user makes a mistake and has to delete a number from the field, I want the default value to reappear, instead of leaving the field blank. Is there a way to make that happen?
 
TIA

My Product Information:
Acrobat Pro 10.0.2, Macintosh
try67
Expert
Registered: Oct 30 2008
Posts: 2398
Accepted Answer
Calculate event:
if (event.value=="") event.value = 0;

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com

Nilea
Registered: May 17 2011
Posts: 3
Thank YOU!!!! that was perfect and works like a charm
try67
Expert
Registered: Oct 30 2008
Posts: 2398
If you want just a general script that will set the default value, use this instead:

if (event.value=="") event.value = event.target.defaultValue;

- AcrobatUsers Community Expert - Contact me personally at try6767 [at] gmail [dot] com
Check out my custom-made scripts website: http://try67.blogspot.com