- 02-12-2012 09:00 AM #1WTF Groupie Array
- Join Date
- Dec 2007
- Posts
- 121
- Thanks
- 0
- Thanked 0 Times in 0 Posts
How can I get an array of the values from the checked checkboxes in a group?
How can I get an array of the values from the checked checkboxes in a group? I know about .serializeArray(), but that gives me a list of objects with name and value attributes
- 02-15-2012 04:49 AM #2WTF Groupie Array
- Join Date
- Oct 2011
- Posts
- 287
- Thanks
- 0
- Thanked 1 Time in 1 Post
here's a concept, it might help..
HTML Code:<input type="checkbox" name="field[]" value="1" /> <input type="checkbox" name="field[]" value="2" /> <input type="checkbox" name="field[]" value="3" /> <input type="checkbox" name="field[]" value="4" /> <input type="checkbox" name="field[]" value="5" /> <script type="text/javascript"> var checkedValues = []; $("input[type=checkbox]").each(function(idx,element){ if(element.checked) checkedFields.push(element.value); }); </script>



LinkBack URL
About LinkBacks
Reply With Quote

Bookmarks