Skip to main content
Inspiring
October 13, 2017
Answered

Using the Cancel button in a popup alert box

  • October 13, 2017
  • 1 reply
  • 1851 views

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?

This topic has been closed for replies.
Correct answer try67

Yes. Use this code:

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

1 reply

try67
Community Expert
try67Community ExpertCorrect answer
Community Expert
October 13, 2017

Yes. Use this code:

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

SIPRNet11Author
Inspiring
October 20, 2017

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!