telerik maskedtextbox with a RegularExpressionValidator

1 posts, 0 answers
  1. Stacy
    Stacy avatar
    110 posts
    Member since:
    Dec 2010

    Posted 27 Apr Link to this post

    I'm using a Telerik maskedtextbox.  Let say the mask is '#####'.
    I can enter 1-5 digits and all is good.

    If I add a RegularExpressionValidator to the field, it will always fail unless I enter exactly the amount of digits specified in the mask.

    ex.
    just the maskedtextbox with mask '#####', I can enter 1, 11, 111, 1111, 11111 and all is good.
    If I add a RegularExpressionValidator, it fails unless the input is 11111.

    The regex expression works with anything as long as it's a number and only has issues when the masked textbox is used.
Back to Top