how to get the checked id's and unchekced ids using jquery
Posted
by kumar
on Stack Overflow
See other posts from Stack Overflow
or by kumar
Published on 2010-06-08T00:31:54Z
Indexed on
2010/06/08
0:42 UTC
Read the original article
Hit count: 259
jQuery
Hello friends using this code I am to get only checked id
$('#PbtnSubmit').click(function(event) {
$('#PricingEditExceptions input[name=PMchk]').each(function() {
if ($("#PricingEditExceptions input:checkbox:checked").length > 0) {
var checked = $('#PricingEditExceptions input[type=checkbox]:checked');
var PMstrIDs = checked.map(function() {
return $(this).val();
}).get().join(',');
$('#1_exceptiontypes').attr('value', exceptiontypes)
$('#1_PMstrIDs').attr('value', PMstrIDs);
} else {
alert("Please select atleast one exception");
event.preventDefault();
}
});
});
the beginForm
<% using (Html.BeginForm("MassUpdate", "Pricing", FormMethod.Post, new { @id = "exc-"}))
I am perfectly getting all my chekced id's to the controler but I need to get both checked as well as uncheked ids' using above code?
thanks
© Stack Overflow or respective owner