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

Acrobat DC Form- Javascript for Multiple Conditional Checkboxes Show/Hide

New Here ,
Jun 19, 2018 Jun 19, 2018

Copy link to clipboard

Copied

I have the following code entered at Document-Level Javascript in my Acrobat Form.  "MS CHECK" is hidden my default.  If either "MS CHECK 12" or "MS CHECK 13" is checked, then "MS CHECK" should appear.  The following code works for that part of it, but when "MS CHECK 12" and "MS CHECK 13" are unchecked, "MS CHECK" stays visible when it should go back to being hidden.  Any suggestions?

{

var c1 = getField("MS 12 CHECK");
var c2 = getField("MS 13 CHECK");
var c3 = getField("MS CHECK");

if(c1 != "Off" || c2 != "Off"){
c3
.display=display.visible;
} else  {
c3
.display=display.hidden;
}


}

TOPICS
Acrobat SDK and JavaScript

Views

240

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 , Jun 19, 2018 Jun 19, 2018

Change line #7 to:

if(c1.valueAsString != "Off" || c2.valueAsString != "Off"){ 

Likes

Translate

Translate
Community Expert ,
Jun 19, 2018 Jun 19, 2018

Copy link to clipboard

Copied

LATEST

Change line #7 to:

if(c1.valueAsString != "Off" || c2.valueAsString != "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