title: 2 validators validate one at a time
body: <p>Hi I have a change password page.</p>
  
  <p>I have 2 <code>textboxes</code>, <code>New Password</code> and <code>Confirm Password</code>.</p>
  
  <p>Both have a <code>requiredFieldValidators</code>.</p>
  
  <p>And a <code>compareValidator</code>. </p>
  
  <p>But what happens is when I key in the first field <code>New Password</code>, the second textbox's <code>requiredFieldValidator</code> and <code>CompareValidator</code> are showing error messages at the same time.</p>
  
  <p>I only want to show <code>requiredFieldValidator</code> and only when that validator returns true, I want to validate <code>compareValidator</code>. </p>
  
  <p>How can I achieve that. The following is my code.</p>
  
  <pre><code>        &lt;table class="editAccTable"&gt;
              &lt;tr&gt;
                  &lt;td&gt;
                      New Password&lt;br /&gt;                      
                      &lt;asp:TextBox ID="txtNewPwd" runat="server" TextMode="Password" Width="204px"&gt;&lt;/asp:TextBox&gt;
                      &lt;br /&gt;
                      &lt;asp:RequiredFieldValidator ID="rfvNewPwd" runat="server"
                      ControlToValidate="txtNewPwd"
                      ValidationGroup="vgChangePwd"
                      Display="Dynamic"
                      &gt;&lt;/asp:RequiredFieldValidator&gt;
                  &lt;/td&gt;
                  &lt;td&gt;
                      Confirm New Password&lt;br /&gt;                      
                      &lt;asp:TextBox ID="txtConfPwd" runat="server" TextMode="Password" Width="204px"&gt;&lt;/asp:TextBox&gt;
                      &lt;br /&gt;
                      &lt;asp:RequiredFieldValidator ID="rfvConfPwd" runat="server"
                      ControlToValidate="txtConfPwd"
                      ValidationGroup="vgChangePwd"
                      Display="Dynamic"
                      &gt;&lt;/asp:RequiredFieldValidator&gt;
                      &lt;asp:CompareValidator ID="cvChangePwd" runat="server"
                      ValidationGroup="vgChangePwd"
                      ControlToValidate="txtNewPwd"
                      ControlToCompare="txtConfPwd"
                      ValueToCompare="String"  
                      Display="Dynamic"                      
                      &gt;&lt;/asp:CompareValidator&gt;
                  &lt;/td&gt;
              &lt;/tr&gt;
              &lt;tr&gt;
                  &lt;td colspan="2"&gt;
                      &lt;asp:ImageButton ID="ibtnPwdChange" runat="server" 
                      ImageUrl="/images/submit.jpg" onclick="ibtnPwdChange_Click" 
                      ValidationGroup="vgChangePwd" 
                      Width="90px" Height="36px"
                      /&gt;
                      &lt;br /&gt;      
                      &lt;asp:Label ID="lblSuccessPwdChange" runat="server"&gt;&lt;/asp:Label&gt;             
                  &lt;/td&gt;
              &lt;/tr&gt;
          &lt;/table&gt;
  </code></pre>