title: How to pass ID to a java script function in ASP.NET
body: <p>Hi, I have following java script function:</p>
  
  <pre><code>function EnableDisableTextBox(chkBoxId, txtBoxId) {
      var isChk = document.getElementById(chkBoxId);
      document.getElementById(txtBoxId).disabled = !(isChk.checked);
  }
  </code></pre>
  
  <p>When I am trying to call above function, by clicking check box its not working as expected</p>
  
  <pre><code>&lt;asp:CheckBox ID="chkBachelors"
        onclick="javascript:EnableDisableTextBox('chkBachelors','txtFirstDegree');"
        runat="server" Text='&lt;%$Resources:Resource, FirstDegree %&gt;' TextAlign="Left"/&gt;
  
  &lt;asp:TextBox ID="txtFirstDegree" CssClass="form-text" runat="server" 
        MaxLength="250"&gt;&amp;lt;/asp:TextBox&gt;
  </code></pre>
  
  <p>Expected Result (When user click <code>chkBachelors</code> check box):</p>
  
  <pre><code>if "chkBachelors" check box is checked 
      then enable "txtFirstDegree" text box
  else 
      disable "txtFirstDegree" text box   
  </code></pre>
  
  <p><strong>What is the problem and how to solve it?</strong>    </p>