dcsimg
www.webdeveloper.com
Results 1 to 2 of 2

Thread: add <br />to end of textarea line

  1. #1
    Join Date
    Aug 2009
    Posts
    53

    add <br />to end of textarea line

    I'm making a comment system & I need to replace the end of a line in a <textarea> with <br />.

    I've tried the nl2br(), but it didn't work, & I tried using a str_replace (the str_replace was probably wrong though).

    both ways turn out with an rn instead of a line break.

    Where I want it to display as:

    Test

    Test

    It comes out as "TestrnrnTest".

  2. #2
    Join Date
    Mar 2007
    Posts
    946
    What is your code for storing the comments into the database? It seems like that is the problem. nl2br() should work

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Tags for this Thread

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center



Recent Articles