ColdFusion 8 autosave not working

I'd like to use the CF8 autosave function to save form data every 30 seconds.  I found a few resources on line ( and Sam Farmer) and have implemented the following:

Added these js functions:

function autoSave(){
ColdFusion.Ajax.submitForm("NameofForm", "URLforprocessingtemplate", setSaveTime);
function autoSaveEvery(ms) {
var timeout=setTimeout("autoSave()",ms);
function setSaveTime(res) {
if (res) {
document.getElementById('messageArea').innerHTML = 'Autosaved at ' + nowFormated();
function nowFormated(){
var now = new Date();
var ampm = "AM";
var hour = new Number(now.getHours());
if (hour > 12) {
ampm = "PM";
hour = hour - 12;
} else if (hour == 0) {
hour = 12;
var minutes = new Number(now.getMinutes());
if (minutes <= 9) {
minutes = "0" + minutes;
var seconds = new Number(now.getSeconds());
if (seconds <= 9) {
seconds = "0" + seconds;
return hour + ":" + minutes + ":" + seconds + " " + ampm;

Also added autoSaveEvery(30000) to the body onload event.

When I open the form, the autosave appears to be working -- every 30 seconds the autosave message is updated indicating the time when the form was saved.   However, nothing is actually saved.  

I've looked over the code and cannot figure out what's missing.  
Who is Participating?
I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

Can you try outputting the value of 'res' in your setSaveTime function?


Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
rfoneillAuthor Commented:

I output res in the message area:

document.getElementById('messageArea').innerHTML = res;

And was able to see the processing template was throwing an error.  I revised my template and it's now working.

Thanks again!!
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
Web Servers

From novice to tech pro — start learning today.