|
|
|||||||||
|
|||||||||
|
|||||||||
| |
||
| |||||||||
![]() |
|
|
«
Previous Thread
|
Next Thread
»
|
Thread Tools | Search this Thread | Rate Thread | Display Modes |
|
#1
|
|||
|
|||
|
Large Form / Cookie data till complete
I have a really long form for a mortage application. On exit of every field on maybe on timer event the field values will be written to a cookie. I heard there is a limit to size of cookie stored on clients pc.
Any got some example code of how todo this. i.e. best to write to cookie every exit from field or create timer event say automatic save of data. |
|
#2
|
||||
|
||||
|
I've accomplished similar accomplishments using Session variables. You can just store them until the form is done. Once the form is complete use Session.Abandon(). This is in case people's browsers are not accepting cookies.
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.
|
|
#3
|
||||
|
||||
|
Correct me if I'm wrong, but if a user is not accepting cookies, then I was under the understanding that session variables would not work either since the session ID is stored as a cookie.
Also, and again my understanding here may be flawed, I didn't think it was possible to access session variables from javascript. If placing the value in either a cookie or session variable as soon as the user enters the data is the desired effect, the javascript would normally be used. In any case I would do the following to set the cookies: place the following in the <head> section of your page Code:
function setCookie(name, value)
{
document.cookie= name + "=" + escape(value) +
}
then in your form modify your <input> tags to include an onchange event Code:
<input type="text" name="LastName" onChange="setCookie('LastName',this.value)">
This will create a cookie name LastName with the value of the whatever the user input to the text field. I hope this helps.
__________________
Neal Schafer The early worm gets eaten. |
|
#4
|
||||
|
||||
|
I'm not sure if the session id is stored as a cookie or not.
|
![]() |
| Viewing: ASP Free Forums > Programming > HTML, JavaScript And CSS Help > Large Form / Cookie data till complete |
| Thread Tools | Search this Thread |
| Display Modes | Rate This Thread |
|
|
|
|