G
Gene Wirchenko
Dear HTMLers:
Suppose I have a textarea control on a page. The user enters a
multi-line comment in it. I need to be able to do some clean up on
the entered value on the frontend, and I want to know what the newline
character(s) is. What can I count on for the value of the newline
character(s)?
I am using IE 9 under Windows 7, and a bit to my surprise, the
newline is LF. I do not want to write browser-specific code though.
I found "It is recommended that user agents canonicalize line
endings to CR, LF (ASCII decimal 13, 10) when submitting the field's
contents. The character set for submitted data should be ISO Latin-1,
unless the server has previously indicated that it can support
alternative character sets." at
http://www.w3.org/TR/REC-html32#textarea, but this does not say
anything about the value before submission.
Sincerely,
Gene Wirchenko
Suppose I have a textarea control on a page. The user enters a
multi-line comment in it. I need to be able to do some clean up on
the entered value on the frontend, and I want to know what the newline
character(s) is. What can I count on for the value of the newline
character(s)?
I am using IE 9 under Windows 7, and a bit to my surprise, the
newline is LF. I do not want to write browser-specific code though.
I found "It is recommended that user agents canonicalize line
endings to CR, LF (ASCII decimal 13, 10) when submitting the field's
contents. The character set for submitted data should be ISO Latin-1,
unless the server has previously indicated that it can support
alternative character sets." at
http://www.w3.org/TR/REC-html32#textarea, but this does not say
anything about the value before submission.
Sincerely,
Gene Wirchenko