How to get two different array checkbox value in Jquery?.

Posted by boss on Stack Overflow See other posts from Stack Overflow or by boss
Published on 2010-03-17T08:09:24Z Indexed on 2010/03/17 8:11 UTC
Read the original article Hit count: 186

Filed under:

Hi.. For example i have 5 checkbox, 3 checkbox with name=a[] and 2 checkbox with name=b[], if i checked array a[] 3checkbox iam getting the same value for b[] checkbox even b[] checkbox not checked. please suggest...

For ur reference:

var selectedAItems = new Array();
$("input[@name='a[]']:checked").each(function() {
    selectedAItems.push($(this).val());
});

var selectedBItems = new Array();
$("input[@name='b[]']:checked").each(function() {
    selectedBItems.push($(this).val());
});
alert(selectedAItems);
alert(selectedBItems );

© Stack Overflow or respective owner

Related posts about jQuery