I am having a lot of trouble with the Contact form AJAX seamless submission project in the Simply Javascript book by Kevin Yank and Cameron Adams Chapter 8.

One of the main reasons I purchased the book was to find out more about AJAX and was pleased to find this generic form submission section that uses the Contact form as an example. I have been pulling my hair out trying to get this form to work and am not getting anywhere.

The only changes to the form I am doing is changing the form action to action="form_mailer.cfm" my ColdFusion page which is simply inserting the form data into a database. The problem I am having is that I keep getting the "The server was unable to be contacted" javascript alert coming up.

My form_mailer.cfm page is a really simple coldfusion insert page, code below.

<!--- Set default value for checkbox if not checked --->
<cfparam name="form.contactNewsletter" default="No">
<cfquery datasource="MyDB" name="FormInsert"> 
insert into ContactForm(contactName, contactEmail, contactType, contactMessage, contactNewsletter, contactMethod)
values ('#form.contactName#','#form.contactEmail#','#form.contactType#','#form.contactMessage#','#form.contactNewsletter#','#form.contactMethod#')
I added the Content type header thinking this could be the problem but now it just submits the form as a normal form, no ajax!. It enters the data in the database table no problem, so I know my ColdFusion page is working fine.

requester.open("POST", form.getAttribute("action"), true);
requester.onreadystatechange = function()
I have tried using both Firefox and IE version 6 and they both do the same things so it doesn't seem to be a browser issue. Using AJAX for seamless form submission is what I need to be able to do, so I'm very frustrated at not being able to get this to work!

Any others having this problem? or suggestions for fixing would be appreciated.