Selecting/Deselecting RadioButton in a GridView using JavaScript

JavaScript to select/deselect RadioButton in GridView.

<script type="text/javascript" language="javascript">
    function RadioCheck(rb) {
        var gv = document.getElementById("<%=gdvDemoreg.ClientID%>");
        var rbs = gv.getElementsByTagName("input");
        var row = rb.parentNode.parentNode;
        for (var i = 0; i < rbs.length; i++) {
            if (rbs[i].type == "radio") {
                if (rbs[i].checked && rbs[i] != rb) {
                    rbs[i].checked = false;
                    break;
                }
            }
        }
    }

</
script> 

Ebook Download
View all
Learn
View all