We are using "RadInput.Net2.dll" and RadMaskedTextBox for phone number. For validating phone number format as (###) ###-####, we are using RegularExpressionValidator.
Below is the code we used
<radI:RadMaskedTextBox ID="txtPhone" runat="server"></radI:RadMaskedTextBox><br />
<asp:RegularExpressionValidator ID="revOtherPhone" Display="dynamic" ControlToValidate="txtPhone" ValidationExpression ="^(\([0-9]\d{2}\)|[0-9]\d{2})[- .]?\d{3}[- .]?\d{4}$" ToolTip="Input other phone" ErrorMessage="Enter the correct phone number." runat="server"></asp:RegularExpressionValidator>
The functionality is working fine OnKeyPress event.
But we do not want to display the error message on every key press. We want to display the error message only on tab / mouse out from text box like demo available in "http://demos.telerik.com/aspnet-ajax/input/examples/common/validation/defaultcs.aspx"
But we have used the same code as mentioned in the demo source code. But we are getting the validation message at every key press event instead of tab out.
Iwe could not find out where the RegularExpressionValidator validation event is setup for RadMaskedTextBox key press. Could you please help me to fix this issue?
Thanks in advance.