Beefy Boxes and Bandwidth Generously Provided by pair Networks
Perl: the Markov chain saw
 
PerlMonks  

Re: Textarea boxes in CGI

by dws (Chancellor)
on Jun 17, 2003 at 18:58 UTC ( [id://266595]=note: print w/replies, xml ) Need Help??


in reply to Textarea boxes in CGI

Does anybody know if CGI textarea boxes do newlines msdos style or unix style?

Browsers tend to send both a carriage-return and a linefeed. I always do

$text =~ s/\r//g;
on whatever comes back from a text area. (Caveat: This might not be the right thing to do if you're on a Mac.)

Another common problem is to emit

<textarea> stuff </textarea>
instead of
<textarea>stuff</textarea>
The former adds newline on your behalf. The latter preserves the original text (except for newline conversion).

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://266595]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others meditating upon the Monastery: (4)
As of 2024-03-29 15:38 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found