Sunday, November 4, 2012

Validating Gridview checkboxes checked or not using Javascript


           
function Validategridcheckboxes()
var isSelected = false;
            var isEntered = false;
            $("[id$='gdvchecks']").each(function()
            {
                noOfAvailMatches = $(this).find("[id*=chkCheck]").length;
                availMatches = $(this).find("[id*=chkCheck]")
                $(availMatches).each(function() {
                    if (this.checked) {
                        isSelected = true;
                    }
                });
            });

            if (isSelected)
            {
                return true;
            }
            else
            {
               
                return false;
            }
}

No comments: