php_novice2007 Posted August 16, 2007 Share Posted August 16, 2007 Hi, how do I write a confirm box with 'ok' or 'cancel' which opens when the user clicks on a link? eg <a href = nextpage.html>Go to next page</a> If the user clicks ok go to nextpage.html otherwise stay on the current page I'm guessing I do something like <a href = nextpage.html onclick=myConfirm();>Go to next page</a> and have myConfirm() return either true or false, does <a> have kinda an "onsubmit" thing..? Thanks~! Quote Link to comment Share on other sites More sharing options...
gurroa Posted August 16, 2007 Share Posted August 16, 2007 use <a href="javascript:if(confirm('Go to next page?')){window.location='nextpage.html';}">Go to next page</a> Quote Link to comment Share on other sites More sharing options...
php_novice2007 Posted August 16, 2007 Author Share Posted August 16, 2007 Thank you! 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.