I’m editing some code and there is a section of JS which wont work at all in IE browsers but does in any other browser.
Using alerts I’ve located the area where the code is not executing in IE.
The data is being saved however the page does not reload as it does in other browsers.
Any debugging tips?
function submitEditForm(fElement){
var jsonObj;
$(fElement).request({
onComplete: function(transport){
jsonObj=transport.responseJSON;
if (jsonObj.success==1){
formHash=$H($(fElement).serialize(true));
formHash.each(function(pair) {
//alert(pair.key + ' = "' + pair.value + '"');
if ($(pair.key)!=null){
if (pair.key.substring(0,5)=="user_"){
//CODE DOES NOT WORK IN IE FROM THIS POINT
if (($(pair.key).getAttribute('type')!=null) && ($(pair.key).getAttribute('type')=="checkbox")){
if (pair.value=='1'){
$(pair.key).checked=true;
} else {
$(pair.key).checked=false;
}
} else {
$(pair.key).update(pair.value);
if ((pair.key=='user_directPhone') && (pair.value=='')){
$(pair.key).update(' ');
}
}
//alert($(pair.key).tagName);
/*if (pair.value==""){
$(pair.key).style.display="none";
} else {
if ($(pair.key).tagName=="span"){
$(pair.key).style.display="inline";
} else {
$(pair.key).style.display="block";
}
}*/
}
}
if ((fElement='firstChoiceForm') || (fElement='secondChoiceForm')) {
window.location.href = window.location.href;
}
});
checkWarnings();
closeEditBox();
} else {
alert(jsonObj.error);
}
}
})
}