Disable Button based on checked items in CheckboxList

Windows Forms using the ClientID
           

   $("#<%=chkMinCedProgramManagers.ClientID %>").find('input[type="checkbox"]').click(function () {
               
                   $("#<%=btnSaveSubGroup.ClientID %>").removeAttr("disabled");
 
//Identify How many checkboxes are checked so that we can toggle the button             
 var prgchecked = $('#<%=chkMinCedProgramManagers.ClientID%>').find('input[type="checkbox"]:checked').length;

//Disable button if we have zero checked

 if (prgchecked===0)

                       $("#<%=btnSaveSubGroup.ClientID %>").attr("disabled", "disabled");
 };


               });

Comments

Popular posts from this blog

Linq Exclude from separate list

Sorting Ascending and Descending

Linq Query Syntax vs Method Syntax