Replies: 3 comments 3 replies
-
that looks like a bug. However, if I understand your requirement correctly, you don't really want '*' because that would allow any invalid character in your string. Try something like <input x-mask:dynamic="function(value) { return (value.length > 0 && value.charAt(0) == '-') ? '-999.99' : '+999.99'}" type="text" /> or <input x-mask:dynamic="function(value) {
if (value.length > 0 && value.charAt(0) == '-') return '-999.99';
if (value.length > 0 && value.charAt(0) == '+') return '+999.99';
return '999.99'}" type="text"/> |
Beta Was this translation helpful? Give feedback.
-
@SimoTod You're correct. I don't really want |
Beta Was this translation helpful? Give feedback.
-
Hi there, Just to mention that viewing the source code of the mask plugin it's seems that
I had the same problem. As a workaround I just copied the minified version and changed the regex value for something like this to allow special characters with alpha characters and numbers:
Maybe there is a better regex expression. I just searched at stackoverflow |
Beta Was this translation helpful? Give feedback.
-
The
*
wildcard forx-mask
mask plugin does not work as expected.I expect the
*
to be any character, but it actually works like thea
wildcard, which only support alpha characters.In the above html, I'd like to support input of positive (+) or negative (-) number between
0
to999.99
, but try to input some number like+123.45
or-123.45
, the+
or-
is not allowed.If this is intended (which I don't think so because any character means not only alpha characters but also characters like
+
,-
should be supported), may I ask is there any other way to support positive (+) or negative (-) number input (without usingtype="number"
)?Package Version
Beta Was this translation helpful? Give feedback.
All reactions