Alert when radio button selected

Explorer ,
Apr 24, 2018

Copy link to clipboard

Copied

I have a radio button ( "Required" or "N/A" ), I would like to display an alert if N/A is selected.  I have attached the following script to the N/A button, but nothing happens.

if(event.value==="N/A"){

  app.alert("Required if ...",1,0,"Required?");

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Change the first line to:

if (event.target.value=="N/A") {

TOPICS
Acrobat SDK and JavaScript, Windows

Views

124

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

Alert when radio button selected

Explorer ,
Apr 24, 2018

Copy link to clipboard

Copied

I have a radio button ( "Required" or "N/A" ), I would like to display an alert if N/A is selected.  I have attached the following script to the N/A button, but nothing happens.

if(event.value==="N/A"){

  app.alert("Required if ...",1,0,"Required?");

}

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Change the first line to:

if (event.target.value=="N/A") {

TOPICS
Acrobat SDK and JavaScript, Windows

Views

125

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
Apr 24, 2018 0
Most Valuable Participant ,
Apr 24, 2018

Copy link to clipboard

Copied

Change the first line to:

if (event.target.value=="N/A") {

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
Reply
Loading...
Apr 24, 2018 0
Explorer ,
Apr 25, 2018

Copy link to clipboard

Copied

I made the changes, but I still do not get an alert when the N/A radio button is selected.

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
Reply
Loading...
Apr 25, 2018 0
Most Valuable Participant ,
Apr 25, 2018

Copy link to clipboard

Copied

Can you share the file with us (via Dropbox, Google Drive, Adobe Cloud, etc.)?

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
Reply
Loading...
Apr 25, 2018 0
MatLac LATEST
Engaged ,
Apr 30, 2018

Copy link to clipboard

Copied

Also,make sure you put the script under the action tab of the radio button that HAS THE VALUE N/A as its export value.  Scripts are not shared across buttons of the same group.

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
Reply
Loading...
Apr 30, 2018 0