Handling Large Forms

  • Thread starter supremeoppressor
  • Start date
S

supremeoppressor

I am looking for a script or method of storing the data a user inputs
in our surveys (forms with 50-100 questions) in a cookie and then if
the user has to leave they can come back and the answers will
automatically be repopulated.

Currently this is a cumbersome process as I have to assign a value to
each form element, I was hoping to get something that would do it
automatically so I can apply it to all of the forms.

Thanks.
 
D

Daz

I am looking for a script or method of storing the data a user inputs
in our surveys (forms with 50-100 questions) in a cookie and then if
the user has to leave they can come back and the answers will
automatically be repopulated.

Currently this is a cumbersome process as I have to assign a value to
each form element, I was hoping to get something that would do it
automatically so I can apply it to all of the forms.

Thanks.


Hi.

I would suggest taking a different route, and using server-side
technology to store the information. If I remember correctly, cookies
are limited to about 4KB in size, each, and you usually won't see an
error when you exceed this limit. Also, I believe this limit varies
from browser to browser. Generall, most browsers only allow up to 300
cookies to be in storage at any one time. If the user clears their
cookies in the meantime, or happens to visit 300 fresh sites before
going back to yours, the information will be lost. Also, the
information stored in the cookies will be sent to your site with each
user retreives a page from your website. For users on dial-up, sending
4KB of cookies will take a very long time indeed.

The only other options you really have, would be to use a session (if
your server supports PHP). This relies on a cookie, and unless changed
from the default only keeps a stored session for 24 hours. Also, you
can use a database, but this would again rely on the user not having
deleted their cookie for your site, and it would be down to you to
manage when data is removed from the database, and how long it's kept
for.

If you used a database, you could easily link information to a user's
IP address. The catch here is that there can be more than one user on
a particular IP address, and also, this poses problems for users using
proxies. I think the best way to store user specific information, is
to use a website login. Not always convenient, but a darn sight more
reliable and secure.

Just my two cents.

Daz.
 
V

VK

I am looking for a script or method of storing the data a user inputs
in our surveys (forms with 50-100 questions) in a cookie and then if
the user has to leave they can come back and the answers will
automatically be repopulated.

Currently this is a cumbersome process as I have to assign a value to
each form element, I was hoping to get something that would do it
automatically so I can apply it to all of the forms.

That is not a code to use, just a FYI of the coming way to do it:

<http://msdn.microsoft.com/library/default.asp?url=/workshop/author/
behaviors/reference/behaviors/userdata.asp>

<http://developer.mozilla.org/en/docs/Session_restore_API>

<http://groups.google.com/group/comp.lang.javascript/msg/
1536638f3531b242> as a history note - the MDC article was re-written
rather radically since then.
 
S

supremeoppressor

Thanks for the info, I guess its not so much the process of storing
the data as it is recalling and populating the form.

Right now I have something like:

<input type=text name=question1 value="$_cookie[question1]">

so for each question i have to put a value in. I am trying to
eliminate that step so i can just write:

<input type=text name=question1> and have a JS script pop the correct
value into the form for me.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,755
Messages
2,569,536
Members
45,007
Latest member
obedient dusk

Latest Threads

Top