Grrr,
Forgive my ranting, but this really irritated me a lot.
<ranting>
I have a page with X checkboxes with the same name.
code like:
var numberofCB = document.forms.updateentitiesform["bla"].length;
ok?
What happens to my surprise:
numberofCB now only contains the number of checkboxes with that name IF
there are more than 1.
Otherwise it is undefined.
I need that for stuff like:
for (var i=0; numberofCB<i ;i++){
document.forms.updateentitiesform["bla[]"][i].checked = false;
}
Which fails when there is only 1 checkbox.
I don't know who decided to start creating the array ONLY when more than 1
element is found, but that guy forces me to start coding stupid branches.
Why not always make it an array?
</ranting>
Thanks for your time.
Regards,
Erwin Moller