RadTextbox validation

3 posts, 0 answers
  1. srinivasskc
    srinivasskc avatar
    12 posts
    Member since:
    Sep 2012

    Posted 29 Aug 2012 Link to this post

    In textbox,cant we restrict to type only alphabets - if we give not to enter numbers.

    Its been heard that Telerik controls cant work with asp.net ajax validations?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 31 Aug 2012 Link to this post


    Try the following JavaScript to allow only numbers in RadTextBox.
    function OnKeyPress(sender, args)
         var text = sender.get_value() + args.get_keyCharacter();
         if (!text.match('^[a-z]+$'))

  3. Vasil
    Vasil avatar
    1604 posts

    Posted 03 Sep 2012 Link to this post

    Hello srinivas,

    On first look the Shinu's solution will work perfectly client side. You will need to validate the values server side also. You can do this by checking the .Text property of RadTextBox manually, or still use asp:Validator for this purpose.

    For using asp:validators in combination with RadInput controls see these resources:

    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.
Back to Top