Last active
August 29, 2015 13:57
-
-
Save co1e/9836194 to your computer and use it in GitHub Desktop.
Check radio/checkbox group for checked elements with group name
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| function checkGroupForCheckedElementsWithGroupName(name) { | |
| var elements; | |
| var flagged; | |
| elements = document.getElementsByName(name); | |
| flagged = true; | |
| for (i = 0; i < elements.length; i++) { | |
| if (elements[i].checked == true) { | |
| flagged = false; | |
| } | |
| } | |
| return flagged; | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment