I need to evaluate the following checkbox fields to make sure the user has selected at least one of the checkboxes. I fugure it's got to be a problem with my logic because if no boxes are checked, a few boxes are checked or all of the boxes are checked, the function shows the alert and returns false every time!
function DoValidation()
{
var frm = document.forms["supplyreg"];
if ((!(frm.ck_Automotive.checked)) || (!(frm.ck_BldgMat.checked)) || (!(frm.ck_Chemicals.checked)) || (!(frm.ck_Computing.checked)) || (!(frm.ck_ConstrucContr.checked)) || (!(frm.ck_FloorCvrng.checked)))
{
alert('Click a box...');
return false;
}
else
{
return true;
}
}
Can anyone see a problem with this logic? Thanks!!!
![[nosmiley] [nosmiley] [nosmiley]](/data/assets/smilies/nosmiley.gif)
function DoValidation()
{
var frm = document.forms["supplyreg"];
if ((!(frm.ck_Automotive.checked)) || (!(frm.ck_BldgMat.checked)) || (!(frm.ck_Chemicals.checked)) || (!(frm.ck_Computing.checked)) || (!(frm.ck_ConstrucContr.checked)) || (!(frm.ck_FloorCvrng.checked)))
{
alert('Click a box...');
return false;
}
else
{
return true;
}
}
Can anyone see a problem with this logic? Thanks!!!
![[nosmiley] [nosmiley] [nosmiley]](/data/assets/smilies/nosmiley.gif)