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? Quote Link to comment 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> Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.