Hey All,

This is what I need to do:
(It has to do with form validation)

I first want to check that a variable is equal to the string: "CONFIRM CHECKED", if it is, continue the function, if not, display an alert message. Then I want it to check that two fields are not equal to each other: if dis_frm.egold.value == dis_frm.referrer.value...

This is what I have, but it's seriously wrong.

function checkIt(el){
var chkd=""
for(var i=0; i<el.length; i++)
if (el[i].type=="checkbox" && el[i].checked) chkd+=el[i].name;

if (chkd!="CONFIRM CHECKED"){
alert("Please check all boxes");
return;
}
if (dis_frm.egold.value == dis_frm.referrer.value){
alert("You cannot refer yourself");
return;
}
else
document.forms["dis_frm"].submit();
dis_frm.sub.value = "Loading...";
}
}