HTML TEXTAREA TRICKY QUESTION

Discussion in 'Programming' started by deriklogov, Sep 3, 2014.

  1. #1
    Hi,

    I need to insert some text into form in textarea field, i need to insert something like that:

    Hello,
    My name
    blab bla

    but everything needs to be inserted in one line, so it should look like

    Hello,<br>My name<br>

    or

    Hello,\nMy name\n

    None of them are working, in first case browser doesnt recognize <br> tag and send it the same way to script, in second case \n replaced with \\n and send to form.

    Please suggest what other options i have to insert paragraphs in one line.
     
    deriklogov, Sep 3, 2014 IP
  2. sarahk

    sarahk iTamer Staff

    Messages:
    28,821
    Likes Received:
    4,539
    Best Answers:
    123
    Trophy Points:
    665
    #2
    Are you trying to use the form or are you the programmer?

    I normally get people to enter in what they want and then when I show it on a page or insert into an html email I use nl2br()
     
    sarahk, Sep 3, 2014 IP
  3. deathshadow

    deathshadow Acclaimed Member

    Messages:
    9,732
    Likes Received:
    1,999
    Best Answers:
    253
    Trophy Points:
    515
    #3
    From where and what language are you trying to output it? PHP? Are you manipulating it from JS? Some other language?
     
    deathshadow, Sep 6, 2014 IP
  4. deriklogov

    deriklogov Well-Known Member

    Messages:
    1,078
    Likes Received:
    22
    Best Answers:
    0
    Trophy Points:
    130
    #4
    Issue solved, Thank you
     
    deriklogov, Sep 6, 2014 IP