how to get the checked ID's on submit click

Posted by rockers on Stack Overflow See other posts from Stack Overflow or by rockers
Published on 2010-06-14T01:01:13Z Indexed on 2010/06/14 1:12 UTC
Read the original article Hit count: 246

Filed under:
$('#PbtnSubmit').click(function(event) {
            alert("ABC");
            $('#PricingEditExceptions input[name=PMchk]').each(function() {
                if ($("#PricingEditExceptions input:checkbox:checked").length > 0) {
                    var checked = $('#PricingEditExceptions input[name=PMchk]:checked');
                    alert(checked);.........................this is not working
                    var PMstrIDs = checked.map(function() {
                        return $(this).val();
                    }).get().join(',');
                    alert(PMstrIDs);
                    $('#1_exceptiontypes').attr('value', exceptiontypes)
                    $('#1_PMstrIDs').attr('value', PMstrIDs);
                } else {
                    alert("Please select atleast one exception");
                    event.preventDefault();
                }
            });

when I use this On submit click i am getting first popup window as ABC.. but this..

 var checked = $('#PricingEditExceptions input[name=PMchk]:checked');

but this returns Object-object.. in both Firefox and IE8.. but in Firefox alert("PMstrIDs"); return exactly how any checkboxes are check.. but in IE8 it is only returning first Checkbox ID not all..is that any differnce between IE8 and Firefox for this behaviour

please can anybody help me out? or can i do this one any other method so that it will work in IE8 browser?

thanks

© Stack Overflow or respective owner

Related posts about jQuery