Tuesday, 20 May 2014

Check All Checkbox in a panel by Javascript

<script type="text/javascript">

        function checkAll(obj1) {
            var checkboxCollection = document.getElementById('<%=pnlTrTe.ClientID %>').getElementsByTagName('input');          
            for (var i = 0; i < checkboxCollection.length; i++) {
                if (checkboxCollection[i].type.toString().toLowerCase() == "checkbox") {
                    checkboxCollection[i].checked = obj1.checked;
                }
            }
        }

    </script>

No comments:

Post a Comment