Click to See Complete Forum and Search --> : confirm script question


jordanj
04-10-2003, 12:06 PM
Hello,

Not sure how to write this certain JavaScript, was hoping I can get some assistance if possible.

I was wondering how you would write the followig script:

When a user fills out an online form and clicks on the submit button, a message window will appear with the information the added to the form. When the message box appears, the user will have the option to accept or cancel. If they accept, the form will continue to submit their information. If they cancel, they will be brought back to the form to make any changes the desire.

Any help would be greatly appreciated.

Thank You;

Jeremy

viravan
04-10-2003, 12:56 PM
You can try something like this (off the top of my head, untested):


<script>
function doSubmit() {
if ( ) {
// do you confirm here, if not accepted return false
return false;
}
document.myForm.submit();
return true;
}
</script>
<form name="myForm" onSubmit="return doSubmit();">
...


V.V.