Top
Home

Prevent Submit on Scan

When you scan a barcode, by default it will also submit the form. This javascript will prevent that from happening.



<script language="javascript">var p = false;</script>
<form method="post" onsubmit = "return(p)">
<input type = "text" name = "text" />
<input type = "submit" value = "submit" name = "submit" onClick = "javascript: p=true;" />
</form>