Please try below solution on codebins:
Note: Add latest jquery.js javascript file on header tag first.
HTML:
<form id="frm1" method="post">
<input type="radio" class="test" checked="checked" value="radio1">
Radio1
<input type="radio" class="test" checked="checked" value="radio2">
Radio2
<input type="radio" class="test" value="radio3">
Radio3
<br/>
<input type="checkbox" class="test" checked="checked" value="check1">
Check1
<input type="checkbox" class="test" value="check2">
Check2
<input type="checkbox" class="test" checked="checked" value="check3">
Check3
<br/>
<input type="submit" value="submit" />
</form>
jQuery within Script tag:
$(function() {
$("#frm1").submit(function() {
$("input.test[type=checkbox]:checked").each(function() {
alert($(this).val());
});
return false;
});
});
I have done above bin on http://codebins.com/bin/4ldqpap