Research JavaScript's "return" keyword. If the user clicks cancel, you want to "return false" from your procedure, which will cancel the default action and/or exit the script.
So, you have a "submit" button. You code the "onclick" event handler, to a function which issues a confirm. If the user presses "Cancel", you return a "false" which cancels the submit.
<input type="submit" onclick="return myConfirmFunc();" />
Reputation Points: 227
Solved Threads: 37
Made Her Cry
Offline 1,697 posts
since Dec 2004