Jump to content

Autosave form data


techtheatre

Recommended Posts

Anyone know a way to autosave the data contained in a form using AJAX?  Basically i have a form with LOTS of fields and it takes a long time to get them all filled out.  I want to set up javascript to run a function every 5 minutes (for example) that silently submits the form.  When the form is submitted all that happens is that the form data is all saved (in MySQL with UPDATE function), so if i could silently submit the form and just let the user continue working without knowing anything even happened, that would be ideal.  Seems like this should be easy, but i can't find a way to submit the form content without redirecting the form to the submission page.  Can this be done silently?

 

Thanks!

:-\

Link to comment
Share on other sites

  • 2 weeks later...

ajax is the way. ajax doesn't actually submit the form however.  Your use javascript to grab the field contents and build the submittal yourself.  it does not use the submit button or the onsubmit event but instead the setTimeOut() javascript function. 

 

since you sound like a newbe, you might want to check into some prewritten javascript libraries like prototype.js.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.