Hi,
I have a form:
<form .. onSubmit="retur n onFormSubmit(th is)">
<input type="checkbox" name="a[]" value="1" />
<input type="checkbox" name="a[]" value="2" />
...
<input type="checkbox" name="a[]" value="n" />
</form>
I'm trying to verify whether any (i.e. >=1) of the fields are selected:
if (f.a.length < 1) {
// fail
}
But it doesn't seem to work.. I figure a's gotta be an array (it is in
php and I'm usually working in php and avoid js, but this is something
I'd rather do in js)
Thanks
Lüph
I have a form:
<form .. onSubmit="retur n onFormSubmit(th is)">
<input type="checkbox" name="a[]" value="1" />
<input type="checkbox" name="a[]" value="2" />
...
<input type="checkbox" name="a[]" value="n" />
</form>
I'm trying to verify whether any (i.e. >=1) of the fields are selected:
if (f.a.length < 1) {
// fail
}
But it doesn't seem to work.. I figure a's gotta be an array (it is in
php and I'm usually working in php and avoid js, but this is something
I'd rather do in js)
Thanks
Lüph
Comment