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

Q1560 In a form with many text fields, how can you ensure that the form is only submitted if the submit button has been pressed?

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

Try this:

<script language="JavaScript"><!--
var buttonPressed = false;
//--></script>

<form onSubmit="return buttonPressed">
...
<input type="Submit" onClick="buttonPressed = true">
</form>

©2018 Martin Webb