Skip to main content
Known Participant
February 6, 2018
Answered

Reset a form button confirmation pop up window not working

  • February 6, 2018
  • 1 reply
  • 5654 views

I have reset form buttons on most of my forms and am trying to add a confirmation pop up that asks if they are sure they want to reset the form.

By clicking cancel or no - the form should still contain the data that was in it, if they click yes it should erase all the form fields.

 

On the action tab of the button properties, I have added the action to run a javascript - and tried numerous scripts found online, moved it above the reset a form action and below.  Most all will pop up, but regardless of what is pressed, the form clears out.

 

I want the option to NOT clear the form after it has been pressed but giving the "second chance" warning pop up and I wouldn't mind dictating what the message says - but that isn't near as important as the action working.

This topic has been closed for replies.
Correct answer try67

You have to do it all in JS. You can't add a separate command to reset the form, as that will always execute.

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
February 6, 2018

You have to do it all in JS. You can't add a separate command to reset the form, as that will always execute.

Known Participant
February 6, 2018

I guess I should have mentioned my beginner skills.  Thank you for pointing that out!!!! 

Known Participant
January 6, 2020

In case you need the code to do it, it would be something like this:

if (app.alert("Are you sure you want to clear this form?",2,2)==4) this.resetForm();


I used this JS and it works great. However, when the user selects "No" it clears the form anyway. How do I get it to not do that?