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

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

261

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
Community Expert ,
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.

Votes

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?

Votes

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

Votes

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!

Votes

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