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

Acrobat DC Pro - Reset 2 interdependent dropdown values to their defaults

Community Beginner ,
Mar 05, 2020 Mar 05, 2020

Copy link to clipboard

Copied

Hi, I have two sets of 10 interdependent dropdowns.

The first set is named "OC TFV YN 1" to "OC TFV YN 10"

The second set is named "OC T YN 1" to "OC T YN 10"

Each dropdown has options "Yes" and "No".

No two dropdowns with the same number can be "Yes".

e.g. "OC TFV YN 1" and "OC T YN 1" cannot both be "Yes".  They can both be "No" or one can be "Yes" and the other "No".

What I want to do is, if the user tries to set both to "Yes" is to give a message that both cannot be "Yes" (this part was easy) and then reset both to "No".

After searching the community, I have tried using

this.resetForm(["OC T YN 1"]);
this.resetForm(["OC TFV YN 1"])

in the validation script for both dropdowns. The option "Commit selected value immediately" is checked on both dropdowns.

Whilst the script works by resetting the "other" dropdown it does not reset the dropdown from which it is invoked.

Any help would be appreciated.

Raymond

 

 

TOPICS
Acrobat SDK and JavaScript

Views

78

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

Community Expert , Mar 05, 2020 Mar 05, 2020

Resetting a field returns it to its default value.

If "No" is the default value then your code should work for the other field, but not of the one that is being edited because you can't change a value while the user is also doing that. What you can do it reject the user's value by using this command:

event.rc = false;

Likes

Translate

Translate
Community Expert ,
Mar 05, 2020 Mar 05, 2020

Copy link to clipboard

Copied

Resetting a field returns it to its default value.

If "No" is the default value then your code should work for the other field, but not of the one that is being edited because you can't change a value while the user is also doing that. What you can do it reject the user's value by using this command:

event.rc = false;

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
Community Expert ,
Mar 05, 2020 Mar 05, 2020

Copy link to clipboard

Copied

LATEST

Use this:

event.rc = false;

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