Using the onSubmit Event to Cancel a Form Submission (Internet Explorer) : Button « Form Control « JavaScript DHTML
- JavaScript DHTML
- Form Control
- Button
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>
Related examples in the same category