in reply to Textarea boxes in CGI

I don't know if there's a point to summarising all the answers so far but in answer to the question:
Does anybody know if CGI textarea boxes do newlines msdos style or unix style?
The answer obviously is:
  1. "No. Because it varies. A lot".
  2. It's possible, due to the WRAP attribute, for there to be linebreaks sent by the form which the user never intended
  3. \r?\n seems to be a good regex.
So if you're in charge of the form's HTML you can ignore the second point, but you should be very careful of the first, because you don't know what browsers are going to do.
--
“Every bit of code is either naturally related to the problem at hand, or else it's an accidental side effect of the fact that you happened to solve the problem using a digital computer.”
M-J D

Replies are listed 'Best First'.
Re^2: Textarea boxes in CGI
by Anonymous Monk on Jun 23, 2010 at 06:33 UTC
    Turn textarea wrapping off by adding 'wrap=off' to your textarea definition.