how many checkboxes?
I have 2 checkboxes with the same name and different values. I have a validation script which checks various form entries (it can be used on any form). I am trying to check that at least one of the values has been checked.
Here is the section of code to do this. For some reason the length is comeing back as undefined. I have tested document.getElementById(objName) and it comes back as an object.
errors=errors+label+' must be selected\n';
What is going wrong?
You can iterate through the checkboxes with the same name using getElementsByName. You are now using getElementById, which will get a specific node matching that id. Ids are unique, so you shouldn't have more than one element with the same id.
Originally Posted by Pepejeria