Check/Uncheck groups of check boxes w/ the same name
I ran into an issue where I needed to check and uncheck groups of check boxes all with the same name attribute. Now JS's DOM allows you to call an object by it's name while CSS allows you to tap into its ID and class. I can check all of them no problem. So how the fark am I going to some of them if they all have the same name?
I could loop through them a write a script to call groups of them by their position in the form like so
document.myform.myboxes[0]= checked
document.myform.myboxes[1]= checked
document.myform.myboxes[1]= checked
But that would suck.
Or I could Google it.
http://www.frequency-decoder.com/demo/checkbox/
This script rocks.Very ingenious.

There are no comments for this entry.
[Add Comment]