views:

44

answers:

1

I have this code in my application

  var checked = $('#fieldset input[type=checkbox]:checked');
                    var ids= checked.map(function() {
                        return $(this).val();
                    }).get().join(',');

in firefox I am getting all the checked Ids something like this.. 123,234,443.. but same code in IE8 its showing only first Id not all checked id's even its checked?

Even if I uncheck the first checkbox if I check second checkbox second checkbox value showing as null?

can anybody help me out? thanks

+1  A: 

try this:

var checked = $('#fieldset').find('input:checkbox:checked');

var ids     = checked.map(function() {
    return this.id;
}).get().join(',');
jAndy