I have a dynamic GridView of students that number of rows it depends on database information
I want that after I press the button i will get a list of all checked PersonID in array/list.
I don't know how to write this JavaScript/jQuery function.
CheckBox:
<asp:CheckBox CssClass="chk" ID="Checkbox" runat="server" Text='<%# Bind("PersonID") %>'></asp:CheckBox>
Button:
<asp:Button ID="Button1" runat="server" Text="Button" OnClientClick="myClosure1()" />
JavaScript:
<script type="text/javascript">
function myClosure1() {
$('.chk').each(function () {
var chkbox = $(this).children('input').get(0);
if (chkbox.checked) {
}
});
}
</script>
I'm not sure it even gets inside the $('.chk').each
Aucun commentaire:
Enregistrer un commentaire