[thelist] ...try again

John Corry jcorry.lists at gmail.com
Sat Aug 22 21:33:21 CDT 2009


I'm through, about to throw the computer out the window (this seems to
always happen when I mess with Javascript)
I have this form I inherited from another developer. It's an ajax form. All
of the validation is set up in javascript and the form button onclick =
get(myform); which calls some javascript functions.

One of the functions creates an XMLHttpRequest object for a POST request:
<code>
      # code to get the right kind of XMLHttpRequest object for http_request
      http_request.onreadystatechange = alertContents;
      http_request.open('POST', url , true);
      http_request.setRequestHeader("Content-type",
"application/x-www-form-urlencoded");
      http_request.setRequestHeader("Content-length", parameters.length);
      http_request.setRequestHeader("Connection", "close");
      http_request.send(parameters);
</code>

I can visit the URL I'm posting data to with my browser and the correct
result is returned: status 200 OK and the page echoes a SUCCESS message.
Firebug lights up with all of the watch expressions I'm looking for when I
just visit the page.

The code above though, when it posts it's data to the page, it gets weird.

Firebug's 'net' tab shows the request and displays a 200 OK response. The
'response' and 'html' tabs don't have the result text ('SUCCESS') or
anything else on them. It's like the AJAX request for the URL returns
nothing.

I'm pulling my hair out.

The boss wants this done by Monday. The decision to do it with Ajax was not
my call...I can't redesign it, just have to make this work.

http://www.belmanklein.com/bda-staging/contact-us.php is the URL...hit the
'Click Here' link to bring up the form.

Anyone?

-- 
John Corry
PHP developer - 3by400, Inc
http://www.3by400.com



More information about the thelist mailing list