﻿
function CheckOnOff(rdoId, gridName) {
    var rdo = document.getElementById(rdoId);
    /* Getting an array of all the "INPUT" controls on the form.*/
    var all = document.getElementsByTagName("input");
    for (i = 0; i < all.length; i++) {
        /*Checking if it is a radio button, and also checking if the
        id of that radio button is different than "rdoId" */
        if (all[i].type == "checkbox" && all[i].id != rdo.id) {
            var count = all[i].id.indexOf(gridName);
            if (count != -1) {
                all[i].checked = false;
            }
        }
    }
    rdo.checked = true; /* Finally making the clicked radio button CHECKED */
}
    
