title: Get error message of page validators for particular group by javascript in asp.net
body: <p>I am trying to write javascript function in which I want to show the error message of the of the invalid fields of the validatiors whose groupname is given.</p>
  
  <p>Basically I am having some different group of validators and want to show there error message in alert if value entered is in valid for the group whose button is pressed using common function.  </p>
  
  <p>I am using following code:</p>
  
  <pre><code>function check(group) {
  
          if (Page_ClientValidate(group)) {
              return true;
          }
          else {
              var message="";
              for (i = 0; i &lt; Page_Validators.length; i++) {
  
                  if (!Page_Validators[i].isValid) {
                      message = message + Page_Validators[i].Errormessage+ "\n";
                  }
              }
              alert("Enter following fields marked with * or Invalid Data\n"+message);
              return false;
          }
  </code></pre>
  
  <p>I want to run following section of code for particular group of validators:</p>
  
  <pre><code>var message="";
                  for (i = 0; i &lt; Page_Validators.length; i++) {
  
                      if (!Page_Validators[i].isValid) {
                          message = message + Page_Validators[i].Errormessage+ "\n";
                      }
                  }
                  alert("Enter following fields marked with * or Invalid Data\n"+message);
                  return false;
              }
  </code></pre>