-
Multiple submit buttons, barcode scanner, return/enter key
I'm relatively new to web programming and a bit over my head with a project
at work. I'm designing web pages for a java servlet based web application
for a library catalogue system. The page i'm working on has the following
features:
A form with 3 submit buttons
type =submit name=submit value=reset
type =submit name=submit value=delete
type =submit name=submit value=add/change
The servlet uses the value to determine how to process the form data.
The last input field on the form is used to scan item numbers using a barcode
scanner. My problem is the scanner always adds a return/enter character at
the end of the item number which submits the form. The problem is the servlet
gets confused because it doesn't know which name/value pair to use to determine
how to process the form data.
I've found a way to supress the enter character using javascript. The user
can now scan the barcode, but they then have to click the add/change button
to submit the form. The users of the sytem (who process hundreds of items
in a batch) want to be able to scan the item number and have the "add/change"
form button activated automatically. Is this possible using javascript events
alone? I don't have any control or understanding of the servlet itself.
My script to supress the enter character from the scanner is below.
<script type="text/javascript"><!--
function noenter() {
return !(window.event && window.event.keyCode == 13); }
//--></script>
<input type="text" name="itemNumber" value="$LAST.itid" onkeypress="return
noenter()"
>
Sorry this is such a long question
Thanks in advance
Dom
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
Forum Rules
|
Top DevX Stories
Easy Web Services with SQL Server 2005 HTTP Endpoints
JavaOne 2005: Java Platform Roadmap Focuses on Ease of Development, Sun Focuses on the "Free" in F.O.S.S.
Wed Yourself to UML with the Power of Associations
Microsoft to Add AJAX Capabilities to ASP.NET
IBM's Cloudscape Versus MySQL
|
Bookmarks