This is a migrated thread and some comments may be shown as answers.

textbox validation still showing

1 Answer 41 Views
Input
This is a migrated thread and some comments may be shown as answers.
randall
Top achievements
Rank 1
randall asked on 17 Feb 2011, 07:04 AM
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>

1 Answer, 1 is accepted

Sort by
0
Vasssek
Top achievements
Rank 1
answered on 19 Feb 2011, 06:00 PM
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
Tags
Input
Asked by
randall
Top achievements
Rank 1
Answers by
Vasssek
Top achievements
Rank 1
Share this question
or