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

disallow characters in a form field

treblig
Registered: Oct 14 2009
Posts: 6

looking to use: text field properties>special>arbitrary mask to disallow specific characters in a field?

My Product Information:
Acrobat Pro 9.1.3, Macintosh
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Can you be more specific?

Do you want to limit to only numbers or alphabetical characters or specify only certain characters?

If you want to limit to certain specific characters, you will need to write custom code for the keystroke using the RegExp object.

George Kaiser

treblig
Registered: Oct 14 2009
Posts: 6
I tried using the "O" parameter to allow only alpha-numeric input, but it appears to require the number of characters to match the number of "O"s.

For this application, I can live with allowing only alpha-numeric (if the number of characters is not restricted). The specific request is to disallow the "." character (period).

Thank you for your help!
gkaiseril
Expert
Registered: Feb 23 2006
Posts: 4308
Have a look at Thom Parker's [url=http://www.acrobatusers.com/tutorials/text-matching-regular-expressions]Text matching with regular expressions[/url]. You can reject the '.' in the custom keystroke or edit it out of the filed with the custom format.

George Kaiser

treblig
Registered: Oct 14 2009
Posts: 6
I don't write Javascript, but the
"\w --Matches word characters a-z, A-Z, 0-9, and the underscore" would solve my problem.

How do I apply that to the format properties of a single Acrobat form field?