View Full Version : Removing First Character of a text box before submitting test box to database
09-22-2005, 05:39 PM
I have a text box that a handheld scanner scans a barcode into. The problem is that the barcodes from the suppiler have an L at the start of the barcode.
Is there a way to remove the first character of a textbox when its inserted into a database.
09-22-2005, 06:57 PM
Using the substring method for strings would probably be easiest. This is just an example as to how to use it. Not sure how you're submitting the data and such, so this is really just an example rather than the implentation you would like. However, using the server-side language that the form is being submitted to would probably be easier if you're just using the form to submit to the database.
var myinput = document.myform.scaninput.value;
document.myform.scaninput.value = myinput.substring(2,myinput.length);
<input type="text" name="scaninput" size="20" />
<input type="button" name="submitinput" onClick="fixInput()" />
Powered by vBulletin® Version 4.2.2 Copyright © 2015 vBulletin Solutions, Inc. All rights reserved.