PDF In-Depth

JavaScript - Displaying an alert dialog on the screen

January 20, 2000


This method enables you to display an alert dialog on the screen. The minimum required parameter is a string containing the message to be displayed. Optionally, an icon type can be specified by using the nIcon parameter. This example uses a button group type.

You can get more detailed information by going to page 32 of the Acrobat Forms JavaScript Object Specification technical note. If you have the Forms plugin this help file is accessible from the Acrobat Help menu.

var answer = app.alert("Do you want to eat sardine salad?", 2, 2);    

/* Question icon, Yes/No button. */
/* 0 = error, 1 = OK, 2 = Cancel, 3 = No, 4 = Yes */

if (answer == 4)
   app.alert("...eat the salad...");
   app.alert("...eat something else...");
PDF In-Depth Free Product Trials Ubiquitous PDF

Debenu Quick PDF Library

Get products to market faster with this amazing PDF developer SDK. Over 900 functions and an equally...

Download free demo

Five visions of a PDF Day

In the world of PDFs or as we like to say Planet (of) PDF, a year isn't a real PDF year without an intense few days of industry knowledge sharing.

May 15, 2018
Platinum Sponsor

Search Planet PDF
more searching options...
Planet PDF Newsletter
Most Popular Articles
Featured Product

Debenu PDF Aerialist

The ultimate plug-in for Adobe Acrobat. Advanced splitting, merging, stamping, bookmarking, and link control. Take Acrobat to the next level.


Adding a PDF Stamp Comment

OK, so you want to stamp your document. Maybe you need to give reviewers some advice about the document's status or sensitivity. This tip from author Ted Padova demonstrates how to add stamps with the Stamp Tool along with related comments.