Home Articles FAQs XREF Games Software Instant Books BBS About FOLDOC RFCs Feedback Sitemap
irt.Org
#

Q45 How do I stop a form from being submitted?

You are here: irt.org | FAQ | JavaScript | Form | 7.3 | Q45 [ previous next ]

Return 'false' within the onSubmit event handler:

<form onSubmit="return false;">
<input type="submit" value="Test Submit">
</form>
<script language="JavaScript"><!--
function myFunction() {
    return false;
}
//--></script>
<form onSubmit="return myFunction();">
<input type="submit" value="Test 2. Submit">
</form>

Feedback on 'Q45 How do I stop a form from being submitted?'

©2018 Martin Webb