H
HugeBob
Hi All,
I'm using the following function to validate a form containing check
boxes. At least one of which must be checked. I call this method in
the form's onsubmit handler thusly: onsubmit="return ValidateForm
(this)". This code works just fine in IE but not in Firefox. In
Firebug, when I attempt to execute form.elements.type == checked it
doesn't seem to like it and continues on. That attribute is valid.
Anyone have any hints as to why this isn't working as in should in FF?
funtion ValidateForm(form)
{
var servicesChecked = false;
for (var i = 0; i < form.elements.length; i++)
{
if (form.elements.type == 'checked')
{
if (form.elements.checked)
{
servicesChecked = true;
break;
}
}
}
return servicesChecked;
}
I'm using the following function to validate a form containing check
boxes. At least one of which must be checked. I call this method in
the form's onsubmit handler thusly: onsubmit="return ValidateForm
(this)". This code works just fine in IE but not in Firefox. In
Firebug, when I attempt to execute form.elements.type == checked it
doesn't seem to like it and continues on. That attribute is valid.
Anyone have any hints as to why this isn't working as in should in FF?
funtion ValidateForm(form)
{
var servicesChecked = false;
for (var i = 0; i < form.elements.length; i++)
{
if (form.elements.type == 'checked')
{
if (form.elements.checked)
{
servicesChecked = true;
break;
}
}
}
return servicesChecked;
}