I have a function validator which make sure the user clicks on all the checkboxes prior to submit, however for loop doesn't seem to be actuated at all and nothing goes into it..
<SCRIPT>
function validate(f)
{
for(i=0;i<f.New_Sizes.length;i++)
{
if(f.New_Sizesїi].checked==false)
{
alert("In order to update, please click on all the checkboxes.");
return false;
}
}
}
</SCRIPT>
what is wrong is that you have named your checkboxes as New_Sizes[] which javascript can't understand, it works well for passing all the values in the group of checkboxes to php as an array but javascript just gives up and dies.
the solution would be if you need to have those check boxes as an array when the form gets submitted would be to use ID tags like so.
<SCRIPT>
function Validate(frm)
{
var elements = frm.elements;
var e = elements.length;
for(var i=0; i<e; i++)
{
if(elementsїi].type=='checkbox' && elementsїi].checked =='false'')
alert("In order to update, please click on all the checkboxes.");
return false;
{
}
</SCRIPT>