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~! Link to comment https://forums.phpfreaks.com/topic/65174-solved-pop-up-box/ 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> Link to comment https://forums.phpfreaks.com/topic/65174-solved-pop-up-box/#findComment-325493 Share on other sites More sharing options...
php_novice2007 Posted August 16, 2007 Author Share Posted August 16, 2007 Thank you! Link to comment https://forums.phpfreaks.com/topic/65174-solved-pop-up-box/#findComment-325645 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.