Thursday, April 23, 2015

ASP.NET CheckBoxList Operations with jQuery - Get Value of Selected Items

 var selectedValues = [];
    $("[id*=CheckBoxList1] input:checked").each(function () {          
        selectedValues.push($(this).val());
    });
    if (selectedValues.length>0) {
        alert("Selected Value(s): " + selectedValues);
    } else {
        alert("No item has been selected.");
    }

No comments:

Post a Comment