Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Need Advice for barcode reader page 1

Status
Not open for further replies.

LyndonOHRC

Programmer
Sep 8, 2005
603
US
I'm starting a new project and one of the pages will be for scaning barcodes.

The first issue I'm facing is the barcode scanner ending each input with a return key. Of course that submits the form.

Following are some of the behaviors the page will have:

1. Validate scanned value - cannot be a duplicate within current form - include a warning alert if duplicate.
2. Create new dynamic input for next scan.
3. Number of items scanned is unknown - typically will be between 5 and 30.

Before I start I would like some advice on the best method to stop form submission until the user submits it. i.e. should I be thinking of trapping the carriage return or including an input button that submits the form.

My server side script is Coldfusion 5.0 and all clients are IE 7.0.

Thanks

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
You should be able to just add onsubmit="return false" to the form and add a form.submit() to your submit button. Here is a test:
Code:
<form action="javascript:alert('Form Submitted')" onsubmit="return false">
<input type=text>
<input type=submit onclick="this.form.submit()">
</form>
Hitting enter in the text box doesn't submit the form, but clicking the button does.

Adam
 
Very good.

Thanks Adam.

Lyndon

---People Remember about 10% of what you say ---They never forget how you made them feel. Covey
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top