PDA

View Full Version : TesxtField maskRe



drilli
30 Aug 2012, 4:39 AM
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 '/'.

Zdeno
30 Aug 2012, 5:30 AM
^(\d*)\/?(\d*)$ for one or none '/' character. Ofc there is many ways how to write this expression.

sword-it
30 Aug 2012, 5:35 AM
Hi drilli,
Try the code give below:

Add regex config to your textfield as given below:



regex:/^([0-9]*\/?[0-9]*)$/

drilli
31 Aug 2012, 7:26 AM
Hi drilli,
Try the code give below:

Add regex config to your textfield as given below:



regex:/^([0-9]*\/?[0-9]*)$/


Great, it worked/ Thank you both for helping me :)