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

We have a radio button form we want to utilize with customers --error on Line 7 -Suggestions on how to fix?

New Here ,
Mar 28, 2018 Mar 28, 2018

Copy link to clipboard

Copied

if('Boiling Water Canner'=="Yes") {

// selected - show radio buttons

this.getField('Boiling Water Pack').display = display.visible; // show radio button

} else if {

// deselected show hide the radio buttons and reset the field

this.getField('Group 1”).display = display.hidden; // hide radio button}

if('Pressure Canner'="Yes") else {

// selected - show radio buttons

this.getField('Pressure Canner Gauge').display = display.visible; // show radio button

} else if {

// deselected show hide the radio buttons and reset the field

this.getField('Group 1”).display = display.hidden; // hide radio button

this.resetForm([‘Group 1’]); // clear radio button

}

if(Dehydration=="Yes") else if {

// deselected show hide the radio buttons and reset the field

this.getField('Group 1”).display = display.hidden; // hide radio button}

TOPICS
Acrobat SDK and JavaScript , Windows

Views

99

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 28, 2018 Mar 28, 2018

Copy link to clipboard

Copied

The error message is probably because you used inconsistent quotes in this line:

this.getField('Group 1”).display = display.hidden;

I would recommend sticking with one type of quotes, either double or single, but they must always be straight. No "curly" quotes allowed!

Also, there's an error already in line 1. That's not how you access the value of a field.

It needs to be:

if (this.getField("Boiling Water Canner").valueAsString=="Yes") {

Same goes for all other instances where you tried to do it.

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 ,
Mar 28, 2018 Mar 28, 2018

Copy link to clipboard

Copied

Great -- I have updated to the following:

if(this.getField("Boiling Water Canner").valueAsString=="Yes") {

// selected - show radio buttons

this.getField('Boiling Water Pack').display = display.visible; // show radio button

} else

// deselected show hide the radio buttons and reset the field

this.getField('Group 1').display = display.hidden; // hide radio button}

if(this.getField("Pressure Canner").valueAsString=="Yes"){

// selected - show radio buttons

this.getField('Pressure Canner Gauge').display = display.visible; // show radio button

} else

// deselected show hide the radio buttons and reset the field

this.getField('Group 1').display = display.hidden; // hide radio button}

} else

// deselected show hide the radio buttons and reset the field

this.getField('Group 1').display = display.hidden; // hide radio button}

if(this.getField("Dehydration").valueAsString=="Yes") {

// selected - show radio buttons

Now an error on line 14 ?

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 28, 2018 Mar 28, 2018

Copy link to clipboard

Copied

What is the exact text of the error message? It usually provides a pretty good idea of what the problem is.

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 ,
Mar 28, 2018 Mar 28, 2018

Copy link to clipboard

Copied

It is giving us

SyntaxError: syntax error

13: at line 14

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 28, 2018 Mar 28, 2018

Copy link to clipboard

Copied

Compare the amount of opening and closing curly brackets in your code...

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 ,
Mar 29, 2018 Mar 29, 2018

Copy link to clipboard

Copied

LATEST

THANK YOU!

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