Uppercase letter or number mask

6 posts, 0 answers
  1. Cristian Apavaloaiei
    Cristian Apavaloaiei avatar
    25 posts
    Member since:
    Aug 2008

    Posted 07 Oct 2010 Link to this post

    I need a masked text box that can accept only IBAN values. The value is of type ROkk BBBB CCCC CCCC CCCC CCCC where kk are digits, BBBB must be uppercase letters and C must be uppercase letters or numbers. Is there any way to achieve this mask using RadMaskedTextBox?
  2. Shinu
    Shinu avatar
    17764 posts
    Member since:
    Mar 2007

    Posted 07 Oct 2010 Link to this post

    Hello,


    I hope the following approach will help you to achieve the required.

    ASPX:
    <telerik:RadMaskedTextBox CssClass="upper" ID="RadMaskedTextBox3" runat="server" Mask="RO## LLLL aaaa aaaa aaaa aaaa"
        DisplayMask="RO## LLLL aaaa aaaa aaaa aaaa">
     </telerik:RadMaskedTextBox>


    CSS:
    <style type="text/css">
        .upper
        {
            text-transform: uppercase;
        }
    </style>



    -Shinu.
  3. UI for ASP.NET Ajax is Ready for VS 2017
  4. Cristian Apavaloaiei
    Cristian Apavaloaiei avatar
    25 posts
    Member since:
    Aug 2008

    Posted 07 Oct 2010 Link to this post

    Thanks, but it doesn't solve my problem completely. This is actually the solution i found for now, but it's not perfect because 'a' masks allow users to type in anything, so for example ~!@#$%^&*()_+ are all valid characters according to the mask.
  5. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 07 Oct 2010 Link to this post

    Hello Cristian,

    You can refer to this documentation topic on how to build masks:

    http://www.telerik.com/help/aspnet-ajax/input_radmaskedtextboxmasks.html

    The uppercase mask is L. For uppercase and numbers I'm assuming if you add <L|#>, in the place of each a in the mask Shinu offered, it should only allow them to select an uppercase letter or number. So something like this:

    RO## LLLL <L|#><L|#><L|#><L|#> <L|#><L|#><L|#><L|#> <L|#><L|#><L|#><L|#> <L|#><L|#><L|#><L|#>

    I hope that helps.
  6. Cristian Apavaloaiei
    Cristian Apavaloaiei avatar
    25 posts
    Member since:
    Aug 2008

    Posted 07 Oct 2010 Link to this post

    Unfortunately, i can't set that kind of mask, <L|#> translates as "allow only the L and # characters". The only option i see is <A|B|C...Z|1|2...9> but there should be an easier way to implement this.
  7. Cori
    Cori avatar
    562 posts
    Member since:
    Jul 2010

    Posted 07 Oct 2010 Link to this post

    I guess listing all the letters is the only to go, since I have no clue why it doesn't accept the L as being a capital letter when used in an Enumeration.
Back to Top
UI for ASP.NET Ajax is Ready for VS 2017