Showing submited text as list

Discussion in 'Programming' started by Site Owner, Aug 2, 2007.

  1. #1
    In a form, I use this to make it easier for the user to make a list without pressing enter...See it here: http://www.freewebs.com/moreauctions/addtext.html

    But when I print the contents of that textarea into a page, the contents come out a as this: • blah • blah blah

    I need it to be printed like this:
    • blah
    • blah blah

    Just need to add a linebreak before each bullet. Any help would be appreciated.
     
    Site Owner, Aug 2, 2007 IP
  2. AstarothSolutions

    AstarothSolutions Peon

    Messages:
    2,680
    Likes Received:
    77
    Best Answers:
    0
    Trophy Points:
    0
    #2
    In a text area the line breaks are represented by a different code than <br />

    Need to know more about what you are trying to achieve and how to be able to really help but with .Net we would use:

    Replace(TextboxID.Text, vbCrLf, "<br />")

    If memory serves me correct there is a HTML tag that will allow Text coding to be displayed correctly but I cannot remember what it is off hand
     
    AstarothSolutions, Aug 2, 2007 IP
  3. Site Owner

    Site Owner Peon

    Messages:
    69
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #3
    OK, let me try to explain better. I have a form where users can enter data using this: http://www.freewebs.com/moreauctions/addtext.html

    After they submit the form, I can later print/echo the text using $showcontent which is the variable for the textarea.

    Now have to somehow get the value of $showcontent, then put a <br> BEFORE each bullet.

    I think javascript would be best for this.
     
    Site Owner, Aug 2, 2007 IP