I am attempting to write an interface to a SQL database where the user
will be able to scan in serial numbers and such and the database will
keep track of it. Unfortunately, the bar code scanners that will be
used always add {W at the beginning of what they scan, and a newline at
the end. I have already succeeded at removing the {W when they exist
(it's possible the user may just type the numbers in the form instead of
scanning it) with a regular expression ($_[0] =~
/(\}W)?(17)?0?-?(\d\d\d\d)/), then pulling out the desired $3. This
might give you an idea of how far along I am with this whole thing. I've
only been working on this on and off for about a week.
As it is, the newline is what is giving me trouble. See, when they scan
it in the HTML form, the newline causes the form to submit prematurely
(before any other fields can be filled). I can't figure out a way to
make it ignore these. Idealy it would just make the curser move to the
next field. I'm afraid I might have to use Javascript, and I'd like to
avoid that if at all possible, because I don't know any Javascript, and
I've already had to teach myself Perl and CGI and SQL just to do this
thing, but I don't see how it's possible to do this server-side (or even
if I should do this server-side). If anyone has any ideas I'd be very
appreciative.
-syco
--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>