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