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

Calculation (sum of multiple fields) no more than 100%

Explorer ,
Nov 14, 2024 Nov 14, 2024

Copy link to clipboard

Copied

I created a field that all calculates to a total, but should be no more than 100%. Is there a way to cap the amount at 100%? I put this in the Validate tab, and it still doesn't work:

Screenshot 2024-11-14 at 4.11.20 PM.png

CORRECTION:

It works with a warning that the value is over 100

Screenshot 2024-11-14 at 4.13.17 PM.png

However, if you click "OK", the value in the calculated field keeps the previous total amount before entering a value in the last number field to be calculated:

Screenshot 2024-11-14 at 4.20.07 PM.png

Is there a way to clear that last number field, or at least, clear the TOTAL field if it is wrong/over 100?

TOPICS
How to , JavaScript , PDF , PDF forms , Standards and accessibility

Views

136

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 , Nov 14, 2024 Nov 14, 2024

Just saw your correction... Try this:

if (event.value>100) {app.alert("Value can't exceed 100."); event.value = "";}

Votes

Translate

Translate
Community Expert ,
Nov 14, 2024 Nov 14, 2024

Copy link to clipboard

Copied

Use the script option with this code:

if (event.value>100) event.value = 100;

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 ,
Nov 14, 2024 Nov 14, 2024

Copy link to clipboard

Copied

Just saw your correction... Try this:

if (event.value>100) {app.alert("Value can't exceed 100."); event.value = "";}

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
Explorer ,
Nov 15, 2024 Nov 15, 2024

Copy link to clipboard

Copied

Thank you so much!!!!

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 ,
Nov 15, 2024 Nov 15, 2024

Copy link to clipboard

Copied

LATEST

Yes.

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