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

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

Explorer ,
Nov 14, 2024 Nov 14, 2024

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
724
Translate
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
1 ACCEPTED SOLUTION
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 = "";}

View solution in original post

Translate
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

Use the script option with this code:

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

Translate
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

Just saw your correction... Try this:

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

Translate
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

Thank you so much!!!!

Translate
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
LATEST

Yes.

Translate
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