EasyCFM.COM ColdFusion Forums / ColdFusion Applications / Autosave feature

   Reply to Discussion | New Discussion << previous || next >> 
Posted By Discussion Topic: Autosave feature

book mark this topic Printer-friendly Version  send this discussion to a friend  new posts last

danarashad
10-23-2007 @ 5:00 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
New Member
Posts: 1
Joined: May 2007

Can someone create a tutorial to autosave forms for CF 7.  I know its in CF 8, but I am using CF 7, and thats a feature I need.  I know it has something to do with ajax?

thanks

CJ
10-23-2007 @ 5:14 PM
Reply
Edit
Profile
Send P.M.
My Gravatar!
Powered by Gravatar
Administrator
Posts: 4262
Joined: Oct 2002

i haven't looked at it, but yes, i'd assume it uses AJAX.  since CFMX 7 isn't natively "AJAX-aware", you'd have to roll your own.

i'd assume you use JavaScript to create a timer... and every 'x' number of seconds make an xmlhttprequest (AJAX) call to the server, passing the form data.  

assuming your form data is saved safely, pass back a 'true' result and update the client (which would be as simple as modifying the innerHTML value of a div to say "form has been autosaved").

for lightweight AJAX calls like this, look into JSMX (http://www.lalabird.com)

you can also check jQuery to see if anyone's written a plugin to do this.  no reason to recreate the wheel Smile  

-CJ-
@ #coldfusion/DALNet
http://charlie.griefer.com

Teachers open the door. You enter by yourself.
—Chinese Proverb


Website Designed and Developed by Pablo Varando.