SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Addict
    Join Date
    Jul 2003
    Location
    Toronto, Ontario
    Posts
    234
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Exclamation <br /> Tags Appearing in Textbox?

    Hey guys,

    I'm building a CMS system and ran into a small problem. When I call back the text into a multiline textbox I get <br />'s appearing. Everytime I hit submit it adds a <br />.

    Code:
    echo '<td align="left" valign="middle"><textarea name="sub" cols="51" rows="3">';
    	$result = mysql_query("SELECT * FROM image WHERE ID = '1'");
    
    	while($row1 = mysql_fetch_assoc($result)){
    		echo nl2br($row1['sub']);	
    	}
    echo '</textarea></td>';
    Is there anyway to omit the <br />'s but keep the actual line breaks in there?

    Any help would be appreciated.

    Thanks,
    Mario
    $ Available For Hire
    Need a website designed or coded? Then feel free to contact me!

    PSP Backgrounds - PSPBG.net || Photoshop Brushes - PSBrushes.net

  2. #2
    SitePoint Wizard guelphdad's Avatar
    Join Date
    Oct 2003
    Location
    St. Catharines, ON Canada
    Posts
    1,708
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    This would be a question for the forum for the front end application you are coding in (PHP, ASP etc.)

  3. #3
    Programming Since 1978 silver trophybronze trophy felgall's Avatar
    Join Date
    Sep 2005
    Location
    Sydney, NSW, Australia
    Posts
    16,839
    Mentioned
    25 Post(s)
    Tagged
    1 Thread(s)
    In plain text you need to save the actual line break characters rather than the HTML equivalent. Nost languages allow \n to be used as a readable reference to a line break character.
    Stephen J Chapman

    javascriptexample.net, Book Reviews, follow me on Twitter
    HTML Help, CSS Help, JavaScript Help, PHP/mySQL Help, blog
    <input name="html5" type="text" required pattern="^$">


Bookmarks

Posting Permissions

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