Cagecrawler Posted February 2, 2007 Share Posted February 2, 2007 When the player clicks on a link, I want to have a popup that checks to see if they want to delete their character. This is the script I have at the moment: <script language="JavaScript"> <!-- function confirm_delete() { var input_box=confirm("Your player will be DELETED from the game. Are you sure you want to do this?"); if (input_box==true) { // When OK is clicked window.location="deleteplayer.php"; } else { // When Cancel is clicked window.location="preferences.php"; } } --> </script> This is my link: <a href=\"deleteplayer.php\" onClick=\"confirm_delete()\">[Harakiri!]</a> It's in PHP, hence me escaping the quotation marks. It works if it's a button, but not if it's a normal link. Any idea why? Link to comment https://forums.phpfreaks.com/topic/36730-solved-confirm-box-not-working/ Share on other sites More sharing options...
Cagecrawler Posted February 2, 2007 Author Share Posted February 2, 2007 Ignore me, the link should have been this: <a href=\'javascript:onClick=confirm_delete()\'>[Harakiri!]</a> Link to comment https://forums.phpfreaks.com/topic/36730-solved-confirm-box-not-working/#findComment-175194 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.