title: Problem with enabling and disabling button control based on the asp.net check box check
body: <p>Hi friends i have a button control which has to be enabled based on my asp.net checkbox check,but when run the code i am facing the problem my button is still disabled even after i perform a checkbox check .is their any property i have set in code behind to acccess the check event.</p>
  
  <p>I am using the following code in my application
  This is my javascript file</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
                      function theChecker() {
                          var checkboxId = '&lt;%=  SpEligible.ClientID %&gt;';
                          alert(checkboxId);
                          if (checkboxId.checked == true)
                               {
                              document.getElementById("SplistButton").disabled = false;
                               }
                               else
                                {
                              document.getElementById("SplistButton").disabled = true;
                                }
                              }
  &lt;/script&gt;
  </code></pre>
  
  <p>This is my code for the checkbox and button is</p>
  
  <pre><code>&lt;asp:CheckBox ID="SpEligible" runat="server" Text="SpEligible" class="cBox"   /&gt;
     &lt;asp:Button ID="SplistButton" runat="server" OnClientClick=" return ShowInsertForm()"    Enabled="false"/&gt;
  </code></pre>
  
  <p>This is my aspx.cs file where i am calling the javascript</p>
  
  <pre><code>SpEligible.Attributes.Add("onclick", "theChecker()");
  </code></pre>