ajx and retaining textarea new lines

Discussion in 'Javascript' started by Chris, Nov 29, 2008.

  1. Chris

    Chris Guest

    I am using ajax to send the value of a form's textarea with something
    like onsubmit=doPreview(this.form.text.value).

    This doesn't give the required result as as new lines from the
    textarea are lost and I need to retain them. How do I retain the new
    lines I am sending to the php script?

    Many thanks,

    Chris
     
    Chris, Nov 29, 2008
    #1
    1. Advertising

  2. Chris

    Erwin Moller Guest

    Chris schreef:
    > I am using ajax to send the value of a form's textarea with something
    > like onsubmit=doPreview(this.form.text.value).
    >
    > This doesn't give the required result as as new lines from the
    > textarea are lost and I need to retain them.


    I don't think so.
    Newlines are send to the webserver just fine.

    How do I retain the new
    > lines I am sending to the php script?


    Are you maybe using virtual?
    <textarea wrap="virtual">

    That will make the browser SHOW word wrap in the textarea box, but will
    not send them as content.

    Regards,
    Erwin Moller

    PS: The obvious: You are NOT thinking that newlines show up in HTML I
    presume. You need <br> for that.


    >
    > Many thanks,
    >
    > Chris



    --
    "There are two ways of constructing a software design: One way is to
    make it so simple that there are obviously no deficiencies, and the
    other way is to make it so complicated that there are no obvious
    deficiencies. The first method is far more difficult."
    -- C.A.R. Hoare
     
    Erwin Moller, Dec 1, 2008
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Joe Wright
    Replies:
    0
    Views:
    553
    Joe Wright
    Jul 27, 2003
  2. Augustus
    Replies:
    1
    Views:
    394
    Ken Schaefer
    Sep 10, 2003
  3. Textarea Inside of a textarea

    , Feb 4, 2006, in forum: ASP General
    Replies:
    6
    Views:
    359
    Anthony Jones
    Feb 5, 2006
  4. David
    Replies:
    2
    Views:
    322
    Tim Slattery
    Sep 18, 2007
  5. Replies:
    1
    Views:
    355
    Bart Van der Donck
    Jul 4, 2007
Loading...

Share This Page