469,949 Members | 2,184 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 469,949 developers. It's quick & easy.

JavaScript/ASP textarea value set to cookie but loses formatting

I am writing the value from a textarea input box to a cookie. Long
story but when I return to the page I want to pull the value from the
cookie and put it back in the textbox. When I do this all the
linebreaks and spaces are removed.

Here is the longer version of the problem if it helps.

Essentially I have a page which sends some form infomation to an ASP
page via sometimes a querystring and sometimes a form. This can happen
several times before the final submit is pressed and the form is sent.
In order to keep the information typed in the text box I assign to a
cookie (it could very long). And write it back when returning to the
page. This works fine via the form and when set via ASP. But when the
page is left and returned to via the querystring I can't send the
contents of the text box via a querystring as it is too long. Hence I
set a cookie in Javascript. When I write it back it loses all the
linebreaks and spaces are removed.
Jul 20 '05 #1
1 2199
Chris Kennedy wrote on 12 Dec 2003 at Fri, 12 Dec 2003 17:26:24
GMT:
I am writing the value from a textarea input box to a cookie.
Long story but when I return to the page I want to pull the
value from the cookie and put it back in the textbox. When I do
this all the linebreaks and spaces are removed.


<snipped longer version>

Are you escaping the value before storing the value? I don't know if
it will necessarily help, but it seems a good place to start. Use the
escape and unescape functions.

Mike

--
Michael Winter
M.******@blueyonder.co.invalid (replace ".invalid" with ".uk")
Jul 20 '05 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

reply views Thread by Gowhera Hussain | last post: by
3 posts views Thread by M Wells | last post: by
9 posts views Thread by John Dalberg | last post: by
3 posts views Thread by gooderthanyou | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.