Skip to main content
creatingforms_pdf
Participating Frequently
May 2, 2019
Question

Make Field Be Either Any Number (Formatted) OR Specific Options?

  • May 2, 2019
  • 2 replies
  • 901 views

Hi internet!

I want a user to be able to fill in a field (titled "Size") with 1 of these 3 options:

  1. Any whole number (with comma separator and no decimals)
  2. TBD
  3. BTS

Is it possible to make this specific field display only 1 of these 3 options, utilizing Adobe Acrobat DC? What I am looking for is kind of a mix of the number format and a drop down option.

Thank you kindly.

This topic has been closed for replies.

2 replies

Thom Parker
Community Expert
Community Expert
May 2, 2019

Yes, a custom validation script is the easiest way to go. 

A validation script sets "event.rc" to true if the entered data is acceptable, and false if it is not.

If set to false, then the entered number is deleted.

here's a script for validating a whole number with a comma

event.value = /^(\d+,)\d+$/;

If you want the user to be restricted in what they can enter, then a keystroke script is used.

Thom Parker - Software Developer at PDFScriptingUse the Acrobat JavaScript Reference early and often
creatingforms_pdf
Participating Frequently
May 3, 2019

try67 Thom Parker Thank you both so much! I ended up creating two radio dial check boxes for the last two options.

try67
Community Expert
Community Expert
May 2, 2019

You would need to write your own custom Validation script to achieve it, and if you want the commas to be added automatically then also your own Format script.