Skip to main content
Inspiring
June 26, 2017
Answered

Stop app.alert pop-up on Reset Form

  • June 26, 2017
  • 1 reply
  • 667 views

I am using the following code to check that the percentage total does not exceed or is under 100%.  When I reset the form I get the pop-up 8 times, one for each calculation.  What do I need to add to stop the app.alert when the form resets and all values are now zero (under 100%)?

if (event.value>100) app.alert("The total cannot exceed 100%.");

if (event.value<100) app.alert("The total must equal 100%. Please continue entering.");

Thank you for your help!

DP

This topic has been closed for replies.
Correct answer try67

You can change:

if (event.value<100)

To:

if (event.value>0 && event.value<100)

However, you need to think about this carefully. The second error message will be displayed even while the user is filling in the fields, and that can be very annoying...

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
June 26, 2017

You can change:

if (event.value<100)

To:

if (event.value>0 && event.value<100)

However, you need to think about this carefully. The second error message will be displayed even while the user is filling in the fields, and that can be very annoying...

diane_ngfAuthor
Inspiring
June 26, 2017

Thanks!  I agree that the second message can be annoying.  I've been debating not using it.  Maybe I'll include it in the first message as a reminder.

You're awesome!

Diane

try67
Community Expert
Community Expert
June 26, 2017

I don't know your document is supposed to work, but if you have four fields and the user must fill in all four you can only show the <100 error message when all four fields are filled-in and the result is not 100.