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

Handling Large Forms

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

Feb 1 '07 #1
Share this Question
Share on Google+
3 Replies

P: n/a
Daz
On Feb 1, 7:32 pm, supremeoppres...@gmail.com wrote:
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.

Feb 1 '07 #2

P: n/a
VK
On Feb 1, 10:32 pm, supremeoppres...@gmail.com wrote:
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/de...rkshop/author/
behaviors/reference/behaviors/userdata.asp>

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

<http://groups.google.com/group/comp....avascript/msg/
1536638f3531b242as a history note - the MDC article was re-written
rather radically since then.

Feb 1 '07 #3

P: n/a
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=question1and have a JS script pop the correct
value into the form for me.

On Feb 1, 2:13 pm, "VK" <schools_r...@yahoo.comwrote:
On Feb 1, 10:32 pm, supremeoppres...@gmail.com wrote:
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/de...rkshop/author/
behaviors/reference/behaviors/userdata.asp>

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

<http://groups.google.com/group/comp....avascript/msg/
1536638f3531b242as a history note - the MDC article was re-written
rather radically since then.

Feb 1 '07 #4

This discussion thread is closed

Replies have been disabled for this discussion.