techtheatre Posted October 15, 2007 Share Posted October 15, 2007 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! :-\ Quote Link to comment Share on other sites More sharing options...
mainewoods Posted October 26, 2007 Share Posted October 26, 2007 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. Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.