Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How to open a pop window with confirm message?

Status
Not open for further replies.

Rosee

IS-IT--Management
Dec 12, 2001
187
US
I want to insert a pop window with message saying "Are you sure you want to close the program?", but don't know how to do it using HTML. Please help.

Also, it will be nice the Internet Explorer closes by itself when user clicks "Yes" on the confimation meesage box. Can this be done using HTML?

Any suggestions would be very much appreciated. Thanks a lot.
 
Add this to your script code in a place where a window with message should be opened:

if (confirm("Are you sure you want to close the program?"))
{
// do something if YES button is clicked
}
esle
{
// do something if Cancel button is clicked
}

This uses standard Javascript Comfirm dialog, and you cannot change the text on buttons on it.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top