napsternapster Posted August 17, 2009 Share Posted August 17, 2009 Hi ppl, Problem The validateServer() function it calls executeAjax using false and works well with all other browsers but not firefox.On firefox submits without geting the response from the server and when I use true it does not work at. I need a way to make sure this function wirks well in all browsers the same way. var server_error //its a global variable function validateServer() { executeAjax(urlinfo_input,"GET","info_type_select","info_type_input","type_error"); executeAjax(urlinfo_input,"GET","group_type_select","group_type_input","group_error"); executeAjax(urlinfo_input,"GET","detailed_type_select","detailed_type_input","detailed_error"); executeAjax(urlinfo_input,"GET","detailed_identifiers_select","detailed_identifiers_input","identifier_error"); if(server_error == 0) { f.submit(); //alert("counter = 0"); } } [\code] [code] function executeAjax(url,method,select_id,input_id,error_id) { var xmlhttp = new GetXmlHttpObject(); if(method == 'GET') { xmlhttp.open(method, url, false); xmlhttp.setRequestHeader("Content-Type", "application/x-www-form-urlencoded; charset=UTF-8"); xmlhttp.onreadystatechange = function() { if(xmlhttp.readyState == 4 && xmlhttp.status == 200) { if(xmlhttp.responseText != 0) { server_error = server_error + 1; document.getElementById(error_id).innerHTML = xmlhttp.responseText; document.getElementById(select_id).style.background = 'red'; document.getElementById(input_id).style.background = 'red'; } } } xmlhttp.send(null); } } Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.