Problems showing a newline within a textarea, once grabbed info from within a db

Discussion in 'PHP' started by reubenrd, Aug 29, 2011.

  1. #1
    Hello,

    Basically i am having a little problem displaying a newline within a textarea. The contents of the text area are grabbed from a database, which have already previously converted all newlines to <br> tags, as i would like to use it within a html page. But i also want to offer a user the chance to edit this data via the use of a textarea. Now the problem is i would like the textarea to display the content in the same way it does on a html document, So i decided to replace <br> with \n once again, and then post the content within the <textarea>...</textarea> tags. But I seem to be getting "content with a \n instead of actually showing the newline itself". How would i overcome this??
     
    reubenrd, Aug 29, 2011 IP
  2. reubenrd

    reubenrd Well-Known Member

    Messages:
    438
    Likes Received:
    17
    Best Answers:
    0
    Trophy Points:
    108
    #2
    Fixed!

    To overcome place "&#10;" within the area, instead of using \n.

    Thanx anyway.
     
    reubenrd, Aug 29, 2011 IP