title: Disable ASP.NET 1.1 Validator using JavaScript - Not Working in Firefox
body: <p>The following attempt works in IE8 but not in Firefox (cannot use JQuery for this):</p>
  
  <pre><code>case 'Template:templateControl:residenceRBL2': 
      if (selected.value == 'Within USA') 
      {
          /* Enable zip textbox and validator */
   document.getElementById("Template_templateControl_zipTxt1").disabled=false;
   ValidatorEnable(document.getElementById('&lt;%=firstPersonZipReqVal.ClientID%&gt;'),
              true);
   ...
      }
      else if (selected.value == 'Outside USA') 
      {
          /* Disable zip textbox and validator */
   document.getElementById("Template_templateControl_zipTxt1").disabled=true;
   ValidatorEnable(document.getElementById('&lt;%=firstPersonZipReqVal.ClientID%&gt;'),
              false);
   ...
      }
      break;
  
      &lt;asp:Label ID="firstPersonZipLabel" Runat="server"&gt;&lt;/asp:Label&gt;&lt;br /&gt;
   &lt;asp:TextBox ID="zipTxt1" Height="19" Width="100" 
          Runat="server"&gt;&lt;/asp:TextBox&gt;
      &lt;asp:RequiredFieldValidator ID="firstPersonZipReqVal" 
          ControlToValidate="zipTxt1" Display="Dynamic" 
              ErrorMessage="First Person Zip" 
                  Runat="server"&gt;*&lt;/asp:RequiredFieldValidator&gt;
  </code></pre>
  
  <p><strong>Description of problem:</strong> depending on a radiobuttonlist selection, a required validator is disabled/re-enabled for a textbox. Basically, if their address is outside USA, then the zip textbox validator is disabled. In Firefox, this will not work at all.</p>
  
  <p><strong>UPDATE 1: 09-07-2010</strong>
  I got the textbox disabled in Firefox; I was using the name attribute instead of the id. My only issue now is how to access the "ClientID" of an ASP.NET validator control in JS?</p>
  
  <p><strong>UPDATE 2: 09-07-2010</strong>
  Per the <a href="http://msdn.microsoft.com/en-us/library/aa479045.aspx#aspplusvalid_clientside" rel="nofollow noreferrer">MSDN documentation</a>, I thought I could do something like this:</p>
  
  <pre><code>ValidatorEnable(firstPersonZipReqVal, false);
  </code></pre>
  
  <p>Unfortunately this doesn't seem to work in Firefox either...</p>
  
  <p><a href="https://stackoverflow.com/questions/422554/asp-net-broken-rendering-of-validation-client-side-code-in-firefox">ASP.NET broken rendering of Validation client side code in Firefox</a></p>
  
  <p><strong>UPDATE 3: 09-08-2010</strong></p>
  
  <p>The reason Firefox is not playing nice is because ASP.NET 1.1 is treating it as a down-level browser. If I put clientTarget="upLevel" in the Page tag, Firefox works as expected. Unfortunately, this breaks the entire site layout. <strong>Is there a more gradual way to fix the browsercaps for Firefox?</strong> <a href="http://codebetter.com/blogs/jeffrey.palermo/archive/2005/06/29/128623.aspx" rel="nofollow noreferrer">This version</a> of browserCaps also breaks the layout.</p>
  
  <p>Current browserCaps in Web.Config look like this:</p>
  
  <pre><code> &lt;browserCaps&gt; 
    &lt;case match="Gecko/[-\d]+"&gt;
     browser=Netscape
     frames=true
     tables=true
     cookies=true
     javascript=true
     javaapplets=true
     ecmascriptversion=1.5
     w3cdomversion=1.0
     css1=true
     css2=true
     xml=true
     tagwriter=System.Web.UI.HtmlTextWriter
     &lt;case match="rv:1.0[^\.](?'letters'\w*)"&gt;
      version=6.0
      majorversion=6
      minorversion=0
      &lt;case match="^b" with="${letters}"&gt;
       beta=true
      &lt;/case&gt;
     &lt;/case&gt;
     &lt;case match="rv:1(\.\d+)(\.\d)?(?'letters'\w*)"&gt;
      version=7.0
      majorversion=7
      minorversion=0
      &lt;case match="^b" with="${letters}"&gt;
       beta=true
      &lt;/case&gt;
     &lt;/case&gt;
    &lt;/case&gt;
   &lt;/browserCaps&gt;
  </code></pre>
  
  <p><strong>UPDATE: 09-11-2010</strong></p>
  
  <p>The following link may provide the answer; can someone assist with the code for the 50 points?</p>
  
  <p><a href="https://web.archive.org/web/20211020134119/https://www.4guysfromrolla.com/articles/051204-1.aspx" rel="nofollow noreferrer">https://web.archive.org/web/20211020134119/https://www.4guysfromrolla.com/articles/051204-1.aspx</a></p>