By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
437,605 Members | 2,153 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 437,605 IT Pros & Developers. It's quick & easy.

JavaScript/ASP textarea value set to cookie but loses formatting

P: n/a
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
Share this Question
Share on Google+
1 Reply


P: n/a
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.