Change form submission (enter to tab)
Posted
by
user1298883
on Stack Overflow
See other posts from Stack Overflow
or by user1298883
Published on 2012-03-29T05:06:41Z
Indexed on
2012/03/29
5:29 UTC
Read the original article
Hit count: 100
JavaScript
|html
I have a real basic form (code below) with a bunch of back-panel PhP. There is a scanner being used to input the data, but instead of tab after each item, it sends an "enter" command.
Is it viable to add javascript to cause enter to instead tab to the next form field, and upon the last form field, submit it instead? I have found a few scripts online, but none that I have tried have worked in Firefox/Chrome.
CODE:
<html><head><title>Barcode Generation</title></head><body>
<fieldset style="width: 300px;">
<form action="generator.php" method="post">
Invoice Number:<input type="text" name="invoice" /><br />
Model Number:<input type="text" name="model" /><br />
Serial Number:<input type="text" name="serial" /><br />
<input type="hidden" name="reload" value="true" />
<input type="submit" />
</form><br /><a href=null>en espanol</a></fieldset>
</body></html>
© Stack Overflow or respective owner