texmansru47 Posted July 9, 2008 Share Posted July 9, 2008 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? Link to comment https://forums.phpfreaks.com/topic/113919-how-to-stop-a-from-a-scan-gun-on-a-php-form/ Share on other sites More sharing options...
nloding Posted July 9, 2008 Share Posted July 9, 2008 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 ... Link to comment https://forums.phpfreaks.com/topic/113919-how-to-stop-a-from-a-scan-gun-on-a-php-form/#findComment-585413 Share on other sites More sharing options...
texmansru47 Posted July 9, 2008 Author Share Posted July 9, 2008 Cool. I will try that. Thanks, Link to comment https://forums.phpfreaks.com/topic/113919-how-to-stop-a-from-a-scan-gun-on-a-php-form/#findComment-585449 Share on other sites More sharing options...
texmansru47 Posted July 9, 2008 Author Share Posted July 9, 2008 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? Link to comment https://forums.phpfreaks.com/topic/113919-how-to-stop-a-from-a-scan-gun-on-a-php-form/#findComment-585483 Share on other sites More sharing options...
cooldude832 Posted July 9, 2008 Share Posted July 9, 2008 you need to look into javascript to automatically move to the next item. You can designate hotkeys and functions. Also you might be able to change your scanner to return a TAB after wards to move fields if u so deisre Link to comment https://forums.phpfreaks.com/topic/113919-how-to-stop-a-from-a-scan-gun-on-a-php-form/#findComment-585493 Share on other sites More sharing options...
texmansru47 Posted July 10, 2008 Author Share Posted July 10, 2008 Any ideas on how I can do that??? I'm not very verse in javascripting. Are there some good tutorials out there about the commands and actions in javascript I could check out? Thanks, Texman Link to comment https://forums.phpfreaks.com/topic/113919-how-to-stop-a-from-a-scan-gun-on-a-php-form/#findComment-586636 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.