title: How to show regular expression validation's message after button click only?
body: <p>Below is my html code. I have a email textbox and there is a login button. I have added a required field validator and regular expression validator for email textbox.</p>
  
  <p>The problem is that when I type some thing in the email textbox browser's auto suggestion shows some list of emails. When I select any of those emails by using down arrow key and enter key it shows the error message for regular expression validation even though email is in proper format.</p>
  
  <pre><code>&lt;asp:RequiredFieldValidator ID="reqValUserName" runat="server" 
      ErrorMessage="Email is required!" 
      ControlToValidate="txtUserName"
      ValidationGroup="validateCredential"
      Display="Dynamic"&gt;
  &lt;/asp:RequiredFieldValidator&gt;
  &lt;asp:RegularExpressionValidator ID="regValUserName" runat="server" 
      ErrorMessage="Incorrect format!"
      ControlToValidate="txtUserName" 
      ValidationExpression="\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*" 
      ValidationGroup="validateCredential"
      Display="Static"&gt;
  &lt;/asp:RegularExpressionValidator&gt;                 
  
       &lt;asp:TextBox ID="txtUserName" runat="server"
             TabIndex="1" CssClass="inputCredential" MaxLength="60"
             AccessKey="E" 
             ValidationGroup="validateCredential"&gt;
       &lt;/asp:TextBox&gt;
  
       &lt;asp:Button ID="btnLogin" runat="server" CssClass="btnPrimary" 
             Text="Login" onclick="btnLogin_Click" 
             ValidationGroup="validateCredential"/&gt;
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/W2Nrg.png" alt="enter image description here"></p>
  
  <p>In this image as you see if I select the email from the suggestion and press enter it is showing the wrong email validation message.</p>
  
  <p>Can anyone please let me know, how to stop this kind of message display?</p>
  
  <p>If there is any clarification needed regarding the question then please add it as a comment.</p>