title: Can a button validate more validation groups?
body: <p>I have 3 types of validators:</p>
  
  <ol>
  <li><p>It is part of "VG1" validation group</p></li>
  <li><p>It is part of "VG2" validation group</p></li>
  <li><p>It is not part of any validation groups</p></li>
  </ol>
  
  <p>I have two buttons, B1 and B2.</p>
  
  <p>I would like to validate B1.Click if and only if all validators of the first and third type successfully validated the controls associated to them.</p>
  
  <p>I would like to validate B2.Click if and only if all validators of the second and third type successfully validated the controls associated to them.</p>
  
  <p>Is this possible in ASP.NET? If so, can you tell me how can I do this or where could I read something which would enlighten me in this question?</p>
  
  <p>EDIT:</p>
  
  <pre><code>    function isValidButton1()
      {
          var VG1 = Page_ClientValidate("VG1");
          var empty = Page_ClientValidate("");
          return VG1 &amp;&amp; empty;
      }
  </code></pre>
  
  <p>This works well, however, if VG1 is invalid, then the messages will disappear, because of the validation of the empty group. Is there a solution to show all validation error messages? Thank you.</p>
  
  <p>EDIT2:</p>
  
  <pre><code>    function isValidSaveAsClosed()
      {
          Page_ClientValidate("");
          Page_ClientValidate("VG1");
          var groups = [];
          groups[0] = undefined;
          groups[1] = "VG1";
          var valid = true;
          for (var f in Page_Validators)
          {
              if (jQuery.inArray(Page_Validators[f].validationGroup, groups) &gt;= 0)
              {
                  ValidatorValidate(Page_Validators[f]);
                  valid = valid &amp;&amp; Page_Validators[f].isvalid;
              }
          }
  
          return valid;
      }
  </code></pre>
  
  <p>The function above solves my problem.</p>