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

New Here ,
Mar 27, 2018 Mar 27, 2018

Copy link to clipboard

Copied

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!

TOPICS
Acrobat SDK and JavaScript

Views

36

Likes

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
Most Valuable Participant ,
Mar 27, 2018 Mar 27, 2018

Copy link to clipboard

Copied

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

Likes

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
New Here ,
Mar 27, 2018 Mar 27, 2018

Copy link to clipboard

Copied

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

Likes

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
Most Valuable Participant ,
Mar 27, 2018 Mar 27, 2018

Copy link to clipboard

Copied

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"]);

Likes

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
New Here ,
Mar 27, 2018 Mar 27, 2018

Copy link to clipboard

Copied

LATEST

Okay that's what I was dreading as this is a very involved project but that will work. Thank you again!

Likes

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