lundi 24 juin 2019

Uncheck all checked checkboxes in gridview column

I have a column of checkboxes in my gridview and upon a button click all images that correspond to the data in the checked rows are downloaded. I would also like that button to uncheck all checked checkboxes but no matter what I try I cannot get it work.

I'm trying to get either of these scripts to work right now, I also cannot tell if I do not have the correct syntax in my vb code to call the first function

<script>
    function unCheck() {
        $('#<%=gv1.ClientID %>').find("input:checkbox").each(function () {
            if (this != false) {
                this.checked = false;
            }
        });
    }
</script>
<script>
    $("#dwnld").click(function () {
        $('#gv1').find("input:checkbox").each(function () {
            this.checked = false;
        });
    });
</script>

ScriptManager.RegisterStartupScript(Page, GetType(Page), "Script", "unCheck();", True)




Aucun commentaire:

Enregistrer un commentaire