title: Using JQuery to disable RequiredFieldValidators
body: <p>I am using JQuery to hide/show a div depending on the selected value of a combo box. This part works fine. However, when hiding the div, the jquery function should also disable 3 RequiredFieldValidators which are in that div. I've been looking online and it seems that this can easily be accomplished using:</p>
  
  <pre><code>ValidatorEnable(ValidatorName, false);
  </code></pre>
  
  <p>But when I try using that method, nothing works, the RequiredFieldValidators still display an error even though the div is hidden.</p>
  
  <p>My JQuery function:</p>
  
  <pre><code>&lt;script type="text/javascript"&gt;
          $(document).ready(function () {
              var det = $("#SponsorDetails");
              $(det).hide();
              var all = $("#AllDetails");
              $(all).hide();
  
              $("#&lt;%=SelectAccount.ClientID %&gt;").click(function () {
                  //hide social worker and sponsor stuff
                  var value = $("#&lt;%=SelectAccount.ClientID %&gt; option:selected").val();
                  if (value == "Social_Worker") {
                      //show social worker stuff
                      $("#AllDetails").show("slow");
                      $("#SponsorDetails").hide("slow");
                      ValidatorEnable(document.getElementById("#&lt;%=AddressValidator.ClientID %&gt;"), false);
                      ValidatorEnable(document.getElementById("#&lt;%=CityValidator.ClientID %&gt;"), false);
                      ValidatorEnable(document.getElementById("#&lt;%=CountryValidator.ClientID %&gt;"), false);
  
                  } else if (value == "Sponsor") {
                      //show sponsor stuff
                      $("#AllDetails").show("slow");
                      $("#SponsorDetails").show("slow");
                      ValidatorEnable(document.getElementById("#&lt;%=AddressValidator.ClientID %&gt;"), true);
                      ValidatorEnable(document.getElementById("#&lt;%=CityValidator.ClientID %&gt;"), true);
                      ValidatorEnable(document.getElementById("#&lt;%=CountryValidator.ClientID %&gt;"), true);
  
                  }
              });
  
          });
  
  
      &lt;/script&gt;
  </code></pre>
  
  <p>Someone suggested I could use Validation groups or a custom validator, but using jquery just seems much simpler but I don't know why it won't work.</p>