Is there a way to save carriage returns in a cookie variable?


DevX Home    Today's Headlines   Articles Archive   Tip Bank   Forums   

Results 1 to 2 of 2

Thread: Is there a way to save carriage returns in a cookie variable?

  1. #1
    Jimmy Guest

    Is there a way to save carriage returns in a cookie variable?


    For instance, I have a textarea with information the user entered... If the
    user enters multiple lines of stuff... how do I save it in a cookie that
    will also save where the user puts the carriage returns?

    Currently I am using javascript to save it into the cookie. In my script,
    I escape the data... then when retrieving it I unescape it. However, the
    carriage returns are lost.

    Is it possible that I'm using the wrong type of textarea? I noticed a wrap=???
    parameter that I can use. Would that affect how carriage returns are being
    recorded?

    Thanks!

    ~jimmy.

  2. #2
    slim shady Guest

    Re: Is there a way to save carriage returns in a cookie variable?

    I think you are using the wrong WRAP parameter in the
    textarea. Given below is a listing of valid WRAP parameters and their
    effects.

    1. WRAP=VIRTUAL means that the text in the box wraps, but it is sent as one
    long continuous string

    2. WRAP=PHYSICAL means that the text in the box wraps, and it is sent that
    way too.

    3. WRAP=OFF means that the text in the box does not wrap, but it is sent
    exactly the way it was typed in
    (Note: This is normally the default.)


    Note : I also run a mailing list/ezine where I regularly
    discuss and try to solve similar problems. You might want
    to sign for it at http://www.geocities.com/nerdfilez/

    Hope you find my advice useful :0)


    slimshady

    : slimshady is the author of the world-famous
    : "Nuts & Bolts HTML Tutor" which can be downloaded
    : for free from http://manavmax.tripod.com/soft/





    "Jimmy" <unreal@angband.org> wrote in message
    news:3ab93f9d$1@news.devx.com...
    >
    > For instance, I have a textarea with information the user entered... If

    the
    > user enters multiple lines of stuff... how do I save it in a cookie that
    > will also save where the user puts the carriage returns?
    >
    > Currently I am using javascript to save it into the cookie. In my script,
    > I escape the data... then when retrieving it I unescape it. However, the
    > carriage returns are lost.
    >
    > Is it possible that I'm using the wrong type of textarea? I noticed a

    wrap=???
    > parameter that I can use. Would that affect how carriage returns are

    being
    > recorded?
    >
    > Thanks!
    >
    > ~jimmy.




Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
HTML5 Development Center
 
 
FAQ
Latest Articles
Java
.NET
XML
Database
Enterprise
Questions? Contact us.
C++
Web Development
Wireless
Latest Tips
Open Source


   Development Centers

   -- Android Development Center
   -- Cloud Development Project Center
   -- HTML5 Development Center
   -- Windows Mobile Development Center