[prev in list] [next in list] [prev in thread] [next in thread] 

List:       perl-win32-web
Subject:    RE: Removing CRLFs from TEXTAREA form field
From:       "Hise, Gregory A" <Greg.Hise () usa ! xerox ! com>
Date:       2001-04-26 14:55:33
[Download RAW message or body]

Thank you James - this appears to have done the trick.

Many thanks.
Greg

-----Original Message-----
From: James Coyle [mailto:james.coyle@ildmail.com]
Sent: Thursday, April 26, 2001 9:39 AM
To: Hise, Gregory A; Perl Tips Win32 Web (E-mail)
Subject: RE: Removing CRLFs from TEXTAREA form field


you could add wrap="soft" to your textarea tag:
<TEXTAREA NAME="ucom" ROWS="5" COLS="50" wrap="soft"></TEXTAREA>

and this should work:
$ucom =~ s/\n//g;
$ucom =~ s/\r//g;

(some platforms/browsers use the \r for enter.)

and make sure you don't have any tabs if you want to import into excel:
$ucom =~ s/\t//g;

 James

>-----Original Message-----
>From: perl-win32-web-admin@listserv.ActiveState.com
>[mailto:perl-win32-web-admin@listserv.ActiveState.com]On Behalf Of Hise,
>Gregory A
>Sent: Thursday, April 26, 2001 10:24 AM
>To: Perl Tips Win32 Web (E-mail)
>Subject: Removing CRLFs from TEXTAREA form field
>
>
>I have an application that requests User Comments from the following form
>field:
>
><TEXTAREA NAME=ucom ROWS=5 COLS=50></TEXTAREA>
>
>The TEXTAREA tag will allow users to enter multiple CRLF, and some of my
>customers are.
>
>I log the comments in a text file along with an ID number.  My problem is
>that I am unable to remove CRLF from TEXTAREA field and that makes 
>importing
>the text file into Access/Excel/whatever a major headache.  I have 
>tried the
>following without success:
>
>$ucom =~ s/\n/  /g;
>or
>$ucom =~ tr/\n/  /;
>
>Any ideas?
>
>Thanks,
>Greg Hise
>_______________________________________________
>Perl-Win32-Web mailing list
>Perl-Win32-Web@listserv.ActiveState.com
>http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web
_______________________________________________
Perl-Win32-Web mailing list
Perl-Win32-Web@listserv.ActiveState.com
http://listserv.ActiveState.com/mailman/listinfo/perl-win32-web

[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic