Skip to main content
Participant
March 27, 2018
Question

How can I use a validation to check if a file has been sabed before resetting only portions of a form?

  • March 27, 2018
  • 1 reply
  • 448 views

I currently have two buttons on my form. One to clear the entire form and another to only clear certain fields. I have added a validation code to ask the user if they saved the form yet. However I have yet to find a way to skip the next action which is the built in "reset form". I have entered a similar validation on the other button but this is easily done since its purpose is to clear the entire thing. Any help would be great thanks!

This topic has been closed for replies.

1 reply

try67
Community Expert
Community Expert
March 27, 2018

You have to reset the form (or part of it) using JavaScript. You can't use conditional logic with any other kind of action.

burget91Author
Participant
March 27, 2018

So unfortunately the only way to clear part of the form is to code in every field that I don't want cleared?

try67
Community Expert
Community Expert
March 27, 2018

No... You need to write a script that resets the fields you want to clear. It would look something like this:

this.resetForm(["Field1", "Field2", "Field3"]);