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

I have built a javascript that works however i want to add in an additional radio button with the value Choice2, when i do this the script stops working

New Here ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

this.getField("AMULAT MECHES").display = (this.getField("Group19").valueAsString == "Choice1") ? display.visible : display.hidden;

TOPICS
Acrobat SDK and JavaScript

Views

89

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 , Apr 17, 2019 Apr 17, 2019

Try this:

this.getField("AMULAT MECHES").display =

(this.getField("Group19").valueAsString == "Choice1" || this.getField("Group19").valueAsString =="Choice2")

? display.visible : display.hidden;

Likes

Translate

Translate
Community Expert ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

How did you add Choice2?

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 ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

I tried various ways

this.getField("AMULAT MECHES").display = (this.getField("Group19").valueAsString == "Choice1" || "Choice2") ? display.visible : display.hidden;

this.getField("AMULAT MECHES").display = (this.getField("Group19").valueAsString == "Choice1") || this.getField("AMULAT MECHES").display = (this.getField("Group19").valueAsString == "Choice2")? display.visible : display.hidden;

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 ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

Almost... Use this:

this.getField("AMULAT MECHES").display = (this.getField("Group19").valueAsString == "Choice1" || this.getField("Group19").valueAsString=="Choice2") ? display.visible : display.hidden;

Or:

var v = this.getField("Group19").valueAsString;

this.getField("AMULAT MECHES").display = (v == "Choice1" || v=="Choice2") ? display.visible : display.hidden;

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 ,
Apr 17, 2019 Apr 17, 2019

Copy link to clipboard

Copied

LATEST

Try this:

this.getField("AMULAT MECHES").display =

(this.getField("Group19").valueAsString == "Choice1" || this.getField("Group19").valueAsString =="Choice2")

? display.visible : display.hidden;

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