Restrict alphabets in dateinput textbox

2 posts, 0 answers
  1. sudheer
    sudheer avatar
    109 posts
    Member since:
    Dec 2008

    Posted 26 Dec 2008 Link to this post


    i have a raddatepicker using skin=webblue,  if user enter alphabetical  and special characters it is allowing  but it should not.
    could anybody help

    Very urgency ...

    Thanks in advance
  2. Dimo
    Dimo avatar
    8478 posts

    Posted 26 Dec 2008 Link to this post

    Hi sudheer,

    You can use the DateInput's KeyPress client-side event handler:


    <telerik:RadDatePicker ID="RadDatePicker1" runat="server"
        <DateInput runat="server" ClientEvents-OnKeyPress="KeyPress" /> 


    function KeyPress(sender, args) 
        var re = /^[0-9\-\:\/]$/; 

    The above code will allow numbers, dashes, colons and slashes. You can remove the unnecessary symbols, according to your requirements.

    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Back to Top