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

Making a field for numbers only, no decimals

Abbica
Registered: Feb 4 2009
Posts: 38

hi, In my properties box for my field, when I format it for numbers it keeps giving me a seperator style for money which I don't want, I just want a box that you can only enter numbers in, i.e. bank account number. does anyone know how I go about this please?

try67
Expert
Registered: Oct 30 2008
Posts: 2399
Use a custom validation script. Enter this:

var patt1=new RegExp(/^\d*$/);event.rc = patt1.test(event.value);

It will only accept a blank value, or a value made out of digits.

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

Abbica
Registered: Feb 4 2009
Posts: 38
Thanks you so much, don't think I would have ever found that out. Scripting. I knew it probably was but didn't want to have to face up to it. Will have to start sometime! Thanks for your help.
try67
Expert
Registered: Oct 30 2008
Posts: 2399
There are some good tutorials on this site, if you're interested in scripting for Acrobat.
I also recommend this tutorial about JavaScript: http://www.w3schools.com/js/default.asp
Be aware, though, that it contains some infromation related to JS in web browsers, which is not applicable to Acrobat. But the core-JS functions described there will work in Acrobat.

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

gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
On the format tab for the field, you can also the number of decimals, monetary symbol if any, and how to display negative numbers. Many of these options are drop down selections.

George Kaiser

Abbica
Registered: Feb 4 2009
Posts: 38
Thank you, I will try the javascript tutorial, try being the operative word for it!!