bradmanning Posted May 1, 2012 Report Share Posted May 1, 2012 Hi all, I'm trying to make a javascript popup that if "cancel" is selected, the form does not submit (and the user updates their selection before clicking submit again) Here's what I have so far: function show_confirm() { var r=confirm("You have indicated that this is an escape, are you sure you wish to submit?"); if (r==true) { alert("Escape Submitted"); } else { What goes here? } } /* On submitting the webform, the function calculate is executed */ document.getElementById("caspioform").onsubmit=show_confirm;   Quote Link to comment Share on other sites More sharing options...
ShWolf Posted May 15, 2012 Report Share Posted May 15, 2012 Hi, Insert code into the footer <script type="text/javascript"> function show_confirm() { var r=confirm("You have indicated that this is an escape, are you sure you wish to submit?"); if (r==true) { document.getElementById("caspioform").submit(); } else { alert("Escape Submitted"); return false; } } document.getElementById("caspioform").onsubmit=show_confirm; </script> Let me know if this helps. Quote Link to comment Share on other sites More sharing options...
bradmanning Posted May 15, 2012 Author Report Share Posted May 15, 2012 Perfect! Thanks. 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.
Note: Your post will require moderator approval before it will be visible.