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

numbering

ceekym
Registered: Mar 19 2010
Posts: 31

If I just want a field to accept only numbers between "1" and "10," how do I do that?

In other words, the instructions are "Number the following items in order of importance (1 thru 10)"... I just want the field to accept "1 through 10... No more or no less.

My Product Information:
Acrobat Pro 8.0, Macintosh
try67
Expert
Registered: Oct 30 2008
Posts: 2398
(I assume the field's format is set to Number)
Put this in the field's validation custom script:
if (event.value<1 || event.value>10) {app.alert("Invalid value.");event.rc=false;}

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

ceekym
Registered: Mar 19 2010
Posts: 31
I tried that, but it did not work... Any other suggestions?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
What do you mean by "did not work"? What happened exactly?

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

ceekym
Registered: Mar 19 2010
Posts: 31
OK, here's what I did...
I copied and paste the code into the "Run custom validation script:" box (Text Field Properties>Validate>Run custom validation script) and I made sure the "Number" option was selected (Text Field Properties>Format>Number) and when I previewed the results, absolutely nothing happened...Now I know I'm not the most "back end" savvy operator, so if I'm doing something wrong, please advise.
try67
Expert
Registered: Oct 30 2008
Posts: 2398
And what happened when you enter "12", for example, to the box?

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

ceekym
Registered: Mar 19 2010
Posts: 31
Nothing... As a matter of fact, I was able to enter as many numbers in the box as the space would allow. So what I ended up doing was "collapsing" the box so only 2 digits would appear... I know, I know, that's not a real solution, but I'm getting pretty desperate!

Also, you seem to be pretty knowledgeable about this stuff, How can you subtract one field from another (difference). I can add (sum +) and multiply (product x)... But how come I can't subtract?
try67
Expert
Registered: Oct 30 2008
Posts: 2398
I suggest you post your file. You probably did something wrong, because the validation script I provided works just fine.

For subtraction use the simple notation field under the Calculation tab of the field that should hold the result, and enter this (adjusting the names of the fields, of course):
field_1 - field_2
(the names of the fields must not have spaces or dots in them)

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