Mega Code Archive

 
Categories / JavaScript DHTML / Form Control
 

Using the onSubmit Event to Cancel a Form Submission (Internet Explorer)

<HTML> <HEAD> <TITLE>On Close</TITLE> <SCRIPT>  function checkForm(e) {     if (!(window.confirm("Do you want to submit the form?")))       e.returnValue = false;   }  </SCRIPT> </HEAD> <BODY> <FORM name="theForm" action="0801.html"     onSubmit = "return checkForm(event)"> <INPUT type=submit> </FORM> </BODY> </HTML>