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

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

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

TOPICS
Acrobat SDK and JavaScript
403
Translate
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;

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

How did you add Choice2?

Translate
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

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;

Translate
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

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;

Translate
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
LATEST

Try this:

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

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

? display.visible : display.hidden;

Translate
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