How do I restrict certain characters in an ext js textbox?
3 answers
To specify restricted characters instead of valid characters, simply enclose ^
in square brackets, which means "any character except ...":
maskRe: /[^!\^]/
(= any character except !
and ^
)
Also see this fiddle .
Also note that it is not necessary to use operators such as +
, ^
and $
, because the regexp used with is maskRe
checked for every single character that needs to be entered, not the field value.
+6
source to share