SitePoint Sponsor

User Tag List

Results 1 to 3 of 3
  1. #1
    SitePoint Guru mdumka's Avatar
    Join Date
    Jul 2003
    Location
    True North
    Posts
    642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    TEXTAREA and PRE tag help

    Hi there,

    I am using a TEXTAREA for a comments field and I want it to display on another page with all line breaks in tact.

    To do this I wrap the contents of the TEXTAREA in a PRE tag and everytime a user hits return/enter in the TEXTAREA it shows up in the PRE tag correct.

    The problem comes when the line of text has to wrap in the TEXTAREA. My TEXTAREA is 300px wide, and so some sentances wrap to another line in the TEXTAREA. The problem is they do not wrap in the PRE tag. I have tried a wrap of PHYSICAL and HARD but neither work ... does anyone know wht the reason for this is?

    Thanks

    Mike

  2. #2
    ✯✯✯ silver trophybronze trophy php_daemon's Avatar
    Join Date
    Mar 2006
    Posts
    5,284
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    You should consider replacing line breaks to <br /> tags server side. If you use php, look at nl2br().
    Saul

  3. #3
    SitePoint Guru mdumka's Avatar
    Join Date
    Jul 2003
    Location
    True North
    Posts
    642
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Sorry buddy ... I have no server side I can play with, I am cut off from the database.


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
  •