I'm developing an assets management system at the moment that integrates into our helpdesk system so we can attach helpdesk tickets to particular assets etc. The system itsself is almost finished, but there's one thing I can't do.
I'm aiming to use a barcode scanner to scan in the serial numbers and asset numbers when adding assets to save time. The problem is the barcode scanner I have sends a return keystroke at the end of sending the data, which my PHP form interprets as submit. What I want to do is get the form to move to the next box if enter is pressed insted of submitting. Is this possible as I've not been able to achieve this.
My PHP and web design skills aren't great, I'm still really learning the basics, so any advice is appreciated.
Not sure if this will work but try setting the form field for the barcode as a textfield rather than a straight text box and that may absorb the return.
If it does work you'll want to parse out the return character in the input but that's something for later.
Cheers webman, pointed me in the right direction. Not managed to get it to move onto the next box yet, but I've got it to ignore the enter keystroke.
For reference incase anyone else wants to do the same the following java function works a treat;
Define this function in your page;
'onKeyPress="disableEnterKey()' when you define your form.
My next challenge is to see if I can convert the enter keystroke into a tab, this is proving to be more dificult as it's not just a case of replacing the '0' with '9' as I hopedCode:<form method="POST" action="add.php" name="form1" enctype="multipart/form-data" onKeyPress="disableEnterKey()">
@maniac: You will usually find that you can 'program' the scanner using a code booklet (a book full of barcodes). You can change things like constant-scanning mode and character to send after after inputting the number.
To move to the next input box, use:
I already looked into this, but the scanner I'm using is very very old, I don't even know what make it is! All I know is it works and it's going to save me hours when I update the assets register at the end of this holiday!Originally Posted by Ric_
@webman Thanks for that, I'll try it when I've got a chance to sit down and do some more work on the program.
There are currently 1 users browsing this thread. (0 members and 1 guests)