Results 1 to 4 of 4

Thread: TesxtField maskRe

  1. #1
    Sencha User
    Join Date
    Jun 2012
    Posts
    12

    Default TesxtField maskRe

    Hi all. I have a textfield in extj 3.4 and a maskRe that allows only numbers and as much as you want '/'. I need a maskRe that allows numbers and only one '/'. Can you please help me in this?

    here is my actual maskRe:

    maskRe: /^([0-9 \/]*)$/ - allows numbers and as much as you want '/'.

  2. #2
    Sencha Premium Member Zdeno's Avatar
    Join Date
    Nov 2009
    Location
    Prague
    Posts
    769

    Default

    ^(\d*)\/?(\d*)$ for one or none '/' character. Ofc there is many ways how to write this expression.

  3. #3
    Sencha User sword-it's Avatar
    Join Date
    May 2012
    Location
    Istanbul
    Posts
    1,335

    Default

    Hi drilli,
    Try the code give below:

    Add regex config to your textfield as given below:

    Code:
     regex:/^([0-9]*\/?[0-9]*)$/
    sword-it.com, Sencha Developer House in Turkey - Istanbul University Technopark Suite 204.

  4. #4
    Sencha User
    Join Date
    Jun 2012
    Posts
    12

    Default

    Quote Originally Posted by sword-it View Post
    Hi drilli,
    Try the code give below:

    Add regex config to your textfield as given below:

    Code:
     regex:/^([0-9]*\/?[0-9]*)$/
    Great, it worked/ Thank you both for helping me

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •