I\'ve run into a bit of an issue. Here\'s a brief explanation.
I have 12 check boxes on a standard form. What I need to do is loop through each of them and learn whi
You can loop through all of the checkboxes by writing $(':checkbox').each(...)
.
If I understand your question correctly, you're looking for the following code:
var str = "";
$(':checkbox').each(function() {
str += this.checked ? "1," : "0,";
});
str = str.substr(0, str.length - 1); //Remove the trailing comma
This code will loop through all of the checkboxes and add either 1,
or 0,
to a string.