AJAX and Forms

Today, while working, I came across this error:

Error: [Exception... "Component returned failure code: 0x80040111 (NS_ERROR_NOT_AVAILABLE) [nsIXMLHttpRequest.status]” nsresult: “0×80040111 (NS_ERROR_NOT_AVAILABLE)” location: “JS frame :: {file}.js :: anonymous :: line 23″ data: no]
Source File: {file}.js
Line: 23

For sake of security [and just because] I replaced the actual file location with {file}.

Anyway, I am doing an AJAX request upon submission of the form, and [for whatever reason] was doing ‘return true;’ upon completion of the AJAX.

return true;

Well, when a browser is trying to handle a form submission, it doesn’t like this. So, I merely changed the ‘return true;’ to ‘return false;’ and voilà !

A quick thanks to Matt Thommes. Although his solution wasn’t my solution, he got me started thinking on the right track.

Nick

Leave a Reply