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

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

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

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.

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

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 ?

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

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

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

It is giving us

SyntaxError: syntax error

13: at line 14

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

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

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

THANK YOU!

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