Jump to content

How to stop a <ENTER> from a scan gun on a php form


texmansru47

Recommended Posts

I saw this solution somewhere before but what I need is the code or a link to solve the problem of when our scan guns read in a barcode, it submits a cartridge return (similar to pressing <ENTER>) it will not close the PHP form.  I need it to only be closed by the user pressing the SUBMIT button on that page.

 

Any ideas of where to find this solution?

That's an HTML/client-side issue, not PHP.  I think it's because the <input type="submit".../> tag automatically picks up an "Enter" keystroke as "Please submit the form."  Try creating the submit button as such:

 

<input type="button" name="submit" value="Submit" onClick="document.formname.submit();" />

 

Replace "formname", obviously ...

Well it does work, but it is not processing a move to the next field on the form.  Before the scanner would submit the form without going down to the next line, but now it scans and leaves the cursor behind the number just scanned... is there a solution to move the cursor to the next field?

 

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.