Amezis 0 Report post Posted December 16, 2005 Basically, I want that a message box pops up when clicking on a specific link. The message box will ask "Are you sure you want to continue?" and then there are two buttons Yes or No / Ok or Cancel.Could someone give a code for it? Share this post Link to post Share on other sites
electriic ink 1 Report post Posted December 17, 2005 The actual function in javascript itself is confirm(). <script type="text/javascript"> <!-- function queryAction() { var confirmmessage = "Are you sure you want to continue?"; var goifokay = "http://site.com/process.php"; var cancelmessage = "Action Cancelled"; if (confirm(confirmmessage)) { window.location = goifokay; } else { alert(cancelmessage); } } //--> </script> The above code must appear between the <head> and </head> tags of your document. <a href="#" onClick="queryAction()"> Click Here! </a> If you place the above code between the <body> and </body> of your document, a link will appear and when you click on it the confirm message will appear. Share this post Link to post Share on other sites
Amezis 0 Report post Posted December 19, 2005 Thanks alot Share this post Link to post Share on other sites
iGuest 3 Report post Posted September 24, 2013 thank you very much Share this post Link to post Share on other sites
iGuest 3 Report post Posted January 31, 2014 when I press [cancel], it still goes forward and directed to the URL please help Share this post Link to post Share on other sites