textbox validation still showing

2 posts, 0 answers
  1. randall
    randall avatar
    40 posts
    Member since:
    Apr 2009

    Posted 17 Feb 2011 Link to this post

    Hi,
    i have the following issues when the user enters the wrong text into a RadTextbox. i've implemented the code below which i found here on this forum to detect if a proper email was entered...while it works at first...the problem is when the wrong/invalid email is entered the error shows up but will not go away.

    example: if i were to enter help@df or some other invalid form... the error pops up (which is great)...however if i then fix the issue like help@df.com, the error still shows so its like its remembering part of what i entered and still showing the error.

    if i were to enter a complete new address like please@please.com then the error is removed.

    so as you can see if the user puts in the wrong email or misses something they will be warned, but the warning will remain even after they fix the issue.

    how do  i refresh the validation process for this Textbox or fix this issue.
    1. can i clear the validation process with a javascript?
    2. maybe different method?


     <telerik:RadTextBox ID="RadTextBox1" runat="server" Width="330px" Skin="Vista" TextMode="MultiLine"
      CssClass="emailcombobox" Font-Names="Arial" Font-Size="10pt" ForeColor="#3366CC"
      ClientEvents-OnBlur="blur" AutoPostBack="true">
       </telerik:RadTextBox>

        <asp:RegularExpressionValidator ID="emailValidator" runat="server" Display="Dynamic"
         SetFocusOnError="True" ErrorMessage="This field may contain only valid e-mail address characters."
        ValidationExpression="^[\w\.\-]+@[a-zA-Z0-9\-]+(\.[a-zA-Z0-9\-]{1,})*(\.[a-zA-Z]{2,3}){1,2}$"
        ControlToValidate="RadTextBox1">
        </asp:RegularExpressionValidator>
  2. Vasssek
    Vasssek avatar
    185 posts
    Member since:
    Aug 2010

    Posted 19 Feb 2011 Link to this post

    Hello,

    try to add this javascript into your radtextbox onblur event:
    Page_ClientValidate('');

    It should validate your page from client side and makes validation error message disappear...

    Vasssek
Back to Top