i'm designing a web interface using only xhr functions for forms processing while it's working perfectly on chrome, it has a very weird behavior on IE and firefox: not all datas are transmisted when submiting a form and there is nothing pointing to something specific when these errors occurs.
my post function looks like this:
function submitForm(formName,formTarget) {
console.log(formName);
var form = document.getElementById(formName);
var formDatax = new FormData(form);
var xhr = new XMLHttpRequest();
xhr.onreadystatechange = function() {
if (xhr.readyState == 4 && (xhr.status == 200 || xhr.status == 0)) {
document.getElementById("mainCenter").innerHTML = xhr.responseText;
} else if (xhr.readyState < 4) {
document.getElementById("mainCenter").innerHTML = "<div class='loadingDiv'></div>";
}
};
xhr.open('POST', formTarget, true);
xhr.send(formDatax);
return false;
}
some forms are sent correclty, some others not (even very simple, like email/password login form)!
did anybody encoutered the same behavior or any clue to correct this ?
thank you !