[thelist] ASP Cookies

Feingold Josh S Josh.S.Feingold at irs.gov
Thu May 2 09:57:01 CDT 2002


This message is in MIME format. Since your mail reader does not understand
this format, some or all of this message may not be legible.
--
[ Picked text/plain from multipart/alternative ]
> is it possible cookies aren't the right approach? can't you feed
> variables from your ASP scripts right into the JS as you're parsing
> and rendering the page to HTML?

Well, I found a work around using the escape function of javascript.  It's
not so great, though, since it doesn't escape the "+" that was the encoding
for spaces. I replaced the "+" with spaces, but that means no "+" can be
inputted in the form since JS can't determine which are encoded and which
are purposeful.

Let me give some background on my application.  I have a form which spans
three html pages since it is too big to fit on one.  As the user fills out
each page, the values of that page are stored in a cookie (using ASP), which
is submitted at the end of the entire form (e.g. after page three).  In the
event that the user hits the backbutton, the JS reads the cookie and puts
the previously inputted values as the default value of the form.

The problem with putting the value of the cookie using
<%=request.cookie("cookiename")%> is that when the back button is hit, the
value in the cached page which JS is working off of doesn't change, so the
values on the page doesn't change. Therefore, I need to use the value of the
cookie from JS.

If you have any other ideas about how to accomplish the same functionality,
I would be glad to hear them.  Specifically, the question is how to best
implement multiple forms while allowing for the fact that users will hit
their back button.

Take care,
Josh







More information about the thelist mailing list