title: Disable requiredfieldvalidator with javascript
body: <p>Firstly I have seen the other threads on this topic and I just want something cleared up that I am stuck on.</p>
  
  <p>I have this textbox control and required field validator:</p>
  
  <pre><code>&lt;td class="style1"&gt;
      &lt;asp:TextBox runat="server" ID="txtFirstname"&gt;&lt;/asp:TextBox&gt;
  &lt;/td&gt;
  &lt;td&gt;
      &lt;asp:RequiredFieldValidator ID="rfvFirstname" runat="server"   ControlToValidate="txtFirstname" &gt;*&lt;/asp:RequiredFieldValidator&gt;
  &lt;/td&gt;
  </code></pre>
  
  <p>And this javascript code</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
      function chkValidators() {
          alert("enter function chkValidators");
          validatorEnable(document.getElementById('&lt;%rfvFirstname%&gt;'), false);
      }
  </code></pre>
  
  <p></p>
  
  <p>This is giving me a compilation error:</p>
  
  <pre><code>Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 
  
  Compiler Error Message: CS1002: ; expected
  
  Source Error:
  
  Line 158:            #line default
  Line 159:            #line hidden
  Line 160:            @__w.Write("\'), false);\r\n         }\r\n   &lt;/script&gt;\r\n");
  Line 161:        }
  Line 162:        
  </code></pre>
  
  <p>Anyone know how to fix this?</p>
  
  <p>Nick</p>