Handling Large Forms

Discussion in 'Javascript' started by supremeoppressor@gmail.com, Feb 1, 2007.

  1. Guest

    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, 2007
    #1
    1. Advertising

  2. Daz Guest

    On Feb 1, 7:32 pm, 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.
     
    Daz, Feb 1, 2007
    #2
    1. Advertising

  3. VK Guest

    On Feb 1, 10:32 pm, 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/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.
     
    VK, Feb 1, 2007
    #3
  4. Guest

    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.



    On Feb 1, 2:13 pm, "VK" <> wrote:
    > On Feb 1, 10:32 pm, 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/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.
     
    , Feb 1, 2007
    #4
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Thomas Due

    Handling large file upload

    Thomas Due, Aug 11, 2003, in forum: ASP .Net
    Replies:
    6
    Views:
    3,969
    Jos Vernon
    Aug 20, 2003
  2. Mikael Gustavsson
    Replies:
    2
    Views:
    486
    Mikael Gustavsson
    Aug 14, 2003
  3. Eric
    Replies:
    2
    Views:
    644
  4. Ketchup
    Replies:
    1
    Views:
    283
    Jan Tielens
    May 25, 2004
  5. Replies:
    5
    Views:
    993
    Xho Jingleheimerschmidt
    Apr 2, 2009
Loading...

Share This Page