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

RadMaskedTextBox with RegularExpressionValidator in RadInput.Net2

2 Answers 104 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Rhbkv
Top achievements
Rank 1
Rhbkv asked on 13 Mar 2012, 10:45 PM
Hi,

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.

2 Answers, 1 is accepted

Sort by
0
Vasil
Telerik team
answered on 15 Mar 2012, 08:54 AM
Hi Rhbkv,

The demo pages are using the latest official release of the controls.
If you observe differences in the behavior that you have problems with most probably we ware fixed it and this is the reason that it works correct in the demos. In this case it would be best to upgrade to the latest version.

Kind regards,
Vasil
the Telerik team
If you want to get updates on new releases, tips and tricks and sneak peeks at our product labs directly from the developers working on the RadControls for ASP.NET AJAX, subscribe to their blog feed now.
0
Rhbkv
Top achievements
Rank 1
answered on 15 Mar 2012, 06:21 PM
Thanks Vasil!
Tags
General Discussions
Asked by
Rhbkv
Top achievements
Rank 1
Answers by
Vasil
Telerik team
Rhbkv
Top achievements
Rank 1
Share this question
or