Using the Cancel button in a popup alert box

Participant ,
Oct 13, 2017

Copy link to clipboard

Copied

I have an alert box setup in Document JavaScripts.  When a user opens a PDF form, this alert box pops up giving them information.  If they click ok, it closes the popup window and takes them to the PDF form.  But the Cancel button does the same thing.  I would like the Cancel button to close the popup window AND the PDF form.  Is this possible?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes. Use this code:

if (app.alert("OK?",2,1)!=1) this.closeDoc(true);

TOPICS
Acrobat SDK and JavaScript, Windows

Views

219

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

Using the Cancel button in a popup alert box

Participant ,
Oct 13, 2017

Copy link to clipboard

Copied

I have an alert box setup in Document JavaScripts.  When a user opens a PDF form, this alert box pops up giving them information.  If they click ok, it closes the popup window and takes them to the PDF form.  But the Cancel button does the same thing.  I would like the Cancel button to close the popup window AND the PDF form.  Is this possible?

Most Valuable Participant
Correct answer by try67 | Most Valuable Participant

Yes. Use this code:

if (app.alert("OK?",2,1)!=1) this.closeDoc(true);

TOPICS
Acrobat SDK and JavaScript, Windows

Views

220

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
Oct 13, 2017 0
Most Valuable Participant ,
Oct 13, 2017

Copy link to clipboard

Copied

Yes. Use this code:

if (app.alert("OK?",2,1)!=1) this.closeDoc(true);

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...
Oct 13, 2017 0
Participant ,
Oct 20, 2017

Copy link to clipboard

Copied

Works like a charm senor!  Thank you...as usual!  I wish I had 1/10th of your knowledge with this code!  I'm working on it though!

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...
Oct 20, 2017 0