I have a JavaScript which works fine in IE , but does not work in Firefox or Chrome. I have pasted the code below.

I am trying to disable everything on a form expect 4 buttons ( 2 main & 2 fa). When I try this code in Firefox, everything including the button is disabled. Please help!!

var XYZAppCheck = document.getElementById('XYZAppCheck');
var main_save_continue = document.getElementById("main_save_continue&q uot;
var main_save_logout = document.getElementById("main_save_logout&quo t;
var fa_save_continue = document.getElementById("fa_save_continue&quo t;
var fa_save_logout = document.getElementById("fa_save_logout" );

if (XYZAppCheck.value > 0) {

var vform;

var vform = document.getElementById('mainform');

var faform;

var faform = document.getElementById('faform');

for (var i = 0; i < vform.length; i++) {

vform.elements.disabled = true;

};

for (var i = 0; i < faform.length; i++) {

faform.elements.disabled = true;

};

main_save_continue.disabled = false;
main_save_logout.disabled = false;
fa_save_continue.disabled = false;
fa_save_logout.disabled = false;

};

};