Re: [PHP] new lines in textareas?




On Sun, 2008-03-30 at 12:29 -0400, tedd wrote:
At 9:26 PM -0700 3/29/08, Mary Anderson wrote:
Hi all,
I have a php script which produces text which is to be displayed
in a textarea. I have the wrap for the text area set to 'hard'. I
need to have newlines inserted in the text.
"\n" and "<br>" don't work. They just get quoted literally in
the text. I suspect I need to use htmlspecialchars , but don't know
what special character to feed it.


Only getting to this now, but doesn't nl2br() do what you want?

--Paul
--
------------------------------------------------------------.
| Chisimba PHP5 Framework - http://avoir.uwc.ac.za |
:------------------------------------------------------------:

All Email originating from UWC is covered by disclaimer
http://www.uwc.ac.za/portal/public/portal_services/disclaimer.htm


Relevant Pages

  • new lines in textareas?
    ... I have a php script which produces text which is to be displayed in a textarea. ... I have the wrap for the text area set to 'hard'. ...
    (php.general)
  • Re: [PHP] new lines in textareas?
    ... a textarea. ... I have the wrap for the text area set to 'hard'. ... I suspect I need to use htmlspecialchars, ...
    (php.general)
  • Re: [PHP] new lines in textareas?
    ... $textdata = 'This is a test\nThis is the second line'; ... the text after submitting through the textarea, ... I have a php script which produces text which is to be displayed in ... I have the wrap for the text area set to 'hard'. ...
    (php.general)
  • Re: textarea wrap
    ... I have googled but not found a solution to wordwrap in a textarea using ... is there a style sheet solution or am i stuck with not being able to force ... But overall it is more standard and reliable to set "wrap" attribute: ... "off" has better cross-browser support, ...
    (comp.infosystems.www.authoring.stylesheets)
  • Re: Additional help needed with preserving textarea CR/LF
    ... and sets the wrap value to hard, which I thought would preserve CR/LF ... in the textarea: ... What wrap attribute does is handling the lines wrapping inside the ...
    (comp.lang.javascript)