Welcome Dialog

Welcome to the Community!

We have a brand new look! Take a tour with us and explore the latest updates on Adobe Support Community.


Reset does not clear required element from fields

New Here ,
Jul 09, 2021 Jul 09, 2021

Copy link to clipboard

Copied

My form includes check boxes, and when a box is checked, it makes another field (calendar) required. The Reset clears all entries from the form, but the calendar filed remains required. This is my code in the check box:

Run JavaScript

this.getField("Text6").required=event.target.value!="Off";

 

The format for the calendar field is mm/dd/yy.

 

The Reset button has all elements selected.

 

What am I doing wrong?

TOPICS
PDF forms

Views

44

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

correct answers 1 Correct answer

Adobe Community Professional , Jul 09, 2021 Jul 09, 2021
The Reset Form command actually does trigger some scripts, namely all of the calculation scripts in the file. So in order to cause it to clear the required property, move the code to the calculation script of the text field and change it to: event.target.required=(this.getField("Check Box1").value!="Off");

Likes

Translate

Translate
Adobe Community Professional ,
Jul 09, 2021 Jul 09, 2021

Copy link to clipboard

Copied

The Reset button doesn't execute scripts.

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
LEGEND ,
Jul 09, 2021 Jul 09, 2021

Copy link to clipboard

Copied

Reset sets each field back to its default value - that is the info given as a default. There is no default visibility, default required etc. - if you change these it is permanent.

 

You can provide a button marked reset which runs a Reset forms action then runs some further scripts to do more resetting to your needs.

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
Adobe Community Professional ,
Jul 09, 2021 Jul 09, 2021

Copy link to clipboard

Copied

The Reset Form command actually does trigger some scripts, namely all of the calculation scripts in the file.

So in order to cause it to clear the required property, move the code to the calculation script of the text field and change it to:

 

event.target.required=(this.getField("Check Box1").value!="Off");

 

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 ,
Jul 19, 2021 Jul 19, 2021

Copy link to clipboard

Copied

LATEST

try67, thank you! Your answer did the trick.

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