gruntyj Posted June 30, 2009 Share Posted June 30, 2009 I am fairly new to PHP so am unsure where to start with this one. I am looking for a "exit popup" type script but with a different. What l need is if the user continues through to the form (i.e. to page "two.php" from "one.php") do nothing. However if user does anything else (i.e. clicks navigation) show "exit.php" Can anyone help with this ? Quote Link to comment Share on other sites More sharing options...
JJ2K Posted June 30, 2009 Share Posted June 30, 2009 I'm not totally sure what you mean, but it sounds like something that could be solved with an if statement. e.g if (user continues through to form) { do nothing } else { show exit.php } Quote Link to comment Share on other sites More sharing options...
nadeemshafi9 Posted June 30, 2009 Share Posted June 30, 2009 it would be somthing like load the window and if they do anything else which would be unfocus from that window then load the exit page using element creation and insertion in js. Quote Link to comment Share on other sites More sharing options...
patrickmvi Posted June 30, 2009 Share Posted June 30, 2009 You could do something like this in JS: function check_exit() { if(!form_submit) { // put code here to display exit message or pop up exit script } return; } var form_submit = false; window.onbeforeunload = check_exit; When you submit your form, you would set your form_submit variable to true which would cause it to skip this exit check. 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.