wow, that's some serious regex just to remove a leading character from a string.
anyway, this is not a CGI issue per se. see if this helps:

http://ppewww.ph.gla.ac.uk/%7eflavell/www/formquestion.html

>>-----Original Message-----
>>From: Shawn Smith [mailto:[EMAIL PROTECTED]
>>Sent: Friday, June 03, 2005 7:27 PM
>>To: beginners-cgi@perl.org
>>Subject: Ignoring enter/newline in forms
>>
>>
>>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>
>>
>>


-----Message Disclaimer-----

This e-mail message is intended only for the use of the individual or
entity to which it is addressed, and may contain information that is
privileged, confidential and exempt from disclosure under applicable law.
If you are not the intended recipient, any dissemination, distribution or
copying of this communication is strictly prohibited. If you have
received this communication in error, please notify us immediately by
reply email to [EMAIL PROTECTED] and delete or destroy all copies of
the original message and attachments thereto. Email sent to or from the
Principal Financial Group or any of its member companies may be retained
as required by law or regulation.

Nothing in this message is intended to constitute an Electronic signature
for purposes of the Uniform Electronic Transactions Act (UETA) or the
Electronic Signatures in Global and National Commerce Act ("E-Sign")
unless a specific statement to the contrary is included in this message.

--
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
<http://learn.perl.org/> <http://learn.perl.org/first-response>


Reply via email to