JavaScript – Displaying an alert dialog on the screen

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...');
}
else
{
app.alert('...eat something else...');
}

You May Also Like

About the Author: Planet PDF Team

Leave a Reply