• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

Max Field in Adobe Acrobat Pro Forms.

New Here ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

I was trying to mess around with maximum values within the fields of my Adobe Form document.

I learned how to do this through the validation tab in the text field properties, but I was trying to set it so that the maximum value for that field would be based on the value of another field, and potential the checking of a check box.

So for instance Field1 would have a maximum value of field2+2, and if a value higher than that would be entered text would appear that would say "The value cannot be higher than field2+2". Alternatively, if a certain checkbox were selected it would change the maximum value and the text would change to be field2+5, rather than field2+2.

I am unsure if any of this is even possible and if so, I clearly dont know how to make it happen, and any help is appreciated.

Views

2.5K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines

correct answers 1 Correct answer

Community Expert , Mar 12, 2019 Mar 12, 2019

HI Rael,

Here's what I have:

  • The numbers are in [FieldZ]

  • A hidden field would yield the highest number in [FieldZ], and in my example is called [Max of FieldZ].

  • Another field would be [[Max of FieldZ] + 2]. That field would add the highest value in FieldZ to 2.

  • My syntax isn't right — just the theory.

Otherwise, JavaScript isn't that hard for calculations, even though I'm better at copy and paste.

In this example, you can see the two field names in the table. This code would go in the field for subtra

...

Votes

Translate

Translate
Community Expert ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

Hi Rael,

Try doing a the calculation in a hidden field.

I'll call it FieldA, and FieldA would calculate Field 2+2.

Field 1 would then have a maximum value of the hidden FieldA.

I just kept reading though, and you want the "2" to be a variable. So that's in another field: FieldB and hidden Field A calculates Field2 + FieldB.

Am I following correctly?

Anyway, use hidden field for the intermediate calculations and come back if it doesn't work (and let us know if it does!)

You could also write JavaScript and do it that way.

~ Jane

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

Thanks for the response. I would definitely wanna avoid writing Java script unless it is the only way to get the job done.

But how do I make it have that maximum value of fieldA? I don't see anything that allows me to set a maximum value. I tried writing it into "Run custom validation script" but it doesn't seem to work the same as it does for making a field auto-calculate.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

An Update:

From what I was just told with Adobe Chat Support, this can only be done with javascript. I have found some info online, but it is all people just writing javascript for specific functions and nothing about how to write the javascript so i have no clue how to apply it to my situation. It does seem the check box method can be done using javascript.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 11, 2019 Mar 11, 2019

Copy link to clipboard

Copied

Hi Rael,

If the MAX function does not work, you may need JavaScript. We have a JavaScript forum, and I can move this thread or you can start a new question.

If you duplicated your fields and they have been renamed FieldA.1, FieldA.2, etc., then they are a family and you need to find the MAX of the family, which is FieldA. (I think that's the direction you are going in.)

All of the Acrobat forums are here: Acrobat  and you will see the one that says JavaScript. I can write some JavaScript, but I really excel at copy and paste. You click Edit for the Custom Calculation Script, then paste into the next dialog. The general principle is that you define your variables, then say what you want it to do. It has to be plain text with straight quotes.

Jane

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Mar 12, 2019 Mar 12, 2019

Copy link to clipboard

Copied

I get what you were suggesting now. I've definitely used that method before, but I don't want it to auto calculate. I want it to allow someone to enter a number, but that that number cant be greater than the other field +2, not just that it would calculate to be the maximum of the two.

Thanks for all of your help. I will simply make this a new question with the javascript section.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Community Expert ,
Mar 12, 2019 Mar 12, 2019

Copy link to clipboard

Copied

LATEST

HI Rael,

Here's what I have:

  • The numbers are in [FieldZ]

  • A hidden field would yield the highest number in [FieldZ], and in my example is called [Max of FieldZ].

  • Another field would be [[Max of FieldZ] + 2]. That field would add the highest value in FieldZ to 2.

  • My syntax isn't right — just the theory.

Otherwise, JavaScript isn't that hard for calculations, even though I'm better at copy and paste.

In this example, you can see the two field names in the table. This code would go in the field for subtract in the Custom Calculation Script. First the variables are defined, then comes the math.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines