RadMaskedTextBox multi-language

2 posts, 0 answers
  1. Alexander
    Alexander avatar
    5 posts
    Member since:
    Jan 2009

    Posted 10 Apr 2009 Link to this post

    Greeting!

    I was tryign to implement RadInput controls to form (due to large amount of simple validations specific for every control) and found that RadMaskedTextBox is made only for engl-lang developmens, while i need to implement Rus mask.

    If there any possibilities or solutions to make it? Or mask will stay there with ASCII [page:0] only and no possible utf-8 implementations can be done?
  2. Pavel
    Admin
    Pavel avatar
    904 posts

    Posted 14 Apr 2009 Link to this post

    Hello Alexander,

    I am afraid that this scenario is not supported out-of-the-box since the MaskedTextBox allows the input of all types of letters. You can prevent the typing of English letters with the following script executed on the OnKeyPress client-side event handler of the control:
    <script type="text/javascript"
        function KeyPress(sender, args) 
        { 
            var keyCode = args.get_keyCode(); 
            if ((keyCode >= 65 && keyCode <= 90) || (keyCode >= 97 && keyCode <= 122)) 
            { 
                sender.raise_error(args); 
                args.set_cancel(true); 
            } 
             
        } 
    </script> 
    <telerik:RadMaskedTextBox ID="RadMaskedTextBox1" runat="server"  
        Mask="llllll"
        <ClientEvents OnKeyPress="KeyPress" /> 
    </telerik:RadMaskedTextBox>     

    Try this and let me know if it helps.

    Best wishes,
    Pavel
    the Telerik team

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