Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Input > RadMaskedTextBox validation
RadControls for ASP.NET are no longer supported (see this page for reference). In case you have inquiries about the Telerik ASP.NET AJAX controls, post them in the pertinent ASP.NET AJAX forums.

Not answered RadMaskedTextBox validation

Feed from this thread
  • liju avatar

    Posted on Jan 4, 2011 (permalink)

    Hi guys,

    i am usung a RadMaskedTextBox in my form.i read in some other thread that the required field validator doesn't work with rad controls.
    So i put a custom validator and wrote a ClientValidationFunction

     function rad_TimeEnds_Validate(sender, args)
        {
        var picker = $find("<%= txtphone.ClientID %>").GetValue();
    //    (___) ___-____
        if (picker.length == 0)
            args.IsValid = false;
        }
    I am using a ValidatorCalloutExtender in the form. but even after using the custom validator the validator call out extender is not working correctly for the rad masked text box

  • Posted on Jan 5, 2011 (permalink)

    Hello Liju,

    As far as I know, most of the RadControls supports RequiredFieldValidator.And for some controls, which doesn't supports RequiredFieldValidator, we need to go for Custom validator. However with RadMaskedTextBox we can use the RequiredFieldValidator.Here is the sample code:

    aspx:
    <telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server" SelectionOnFocus="SelectAll"
                Label="IP address: " PromptChar="_" Width="300px" Mask="###:##">
    </telerik:RadMaskedTextBox>
    <asp:RequiredFieldValidator ID="RequiredFieldValidator1"  ControlToValidate="RadMaskedTextBox1" runat="server" ErrorMessage="RequiredFieldValidator">
    </asp:RequiredFieldValidator>


    Shinu.

Back to Top

Skip Navigation LinksHome / Community & Support / Developer Productivity Tools Forums / ASP.NET > Input > RadMaskedTextBox validation