13 Oct 2011

Checkboxlist atleast on item checked in javascript

//id  is the client id of checkbox list
function isChecked(id)
    {
        var chkListModules= document.getElementById (id);
        var chkListinputs = chkListModules.getElementsByTagName("input");
        for (var i=0;i<chkListinputs.length;i++)
        {
            if (chkListinputs[i].checked)
            {
                return true;
            }
        }
        return false;
    }

No comments:

Post a Comment