Open HoecusPocus opened 6 years ago
I have a similar problem. What I want is for the mask to only allow values between 1 and 100. When I use version 3.x the mask works perfect. When trying to use version 4.x, the word "Regex" is displayed in the input. Here's the way I'm using it:
$(document).ready(function(){ $("#example1").inputmask('Regex', { regex: "^[1-9][0-9]?$|^100$" }); });
I tried changing the syntax to:
$(document).ready(function(){ $("#example1").inputmask({ regex: "(^([1-9][0-9]$)|(^100$))" }); });
Now the input is always shown "^__$"
I ask the same question: is it a bug or am I using the library badly?
I could find this solution:
$(document).ready(function(){ $("#example1").inputmask({ regex: "^([0-9]|[1-9][0-9]|10[0])$" }); });
I really do not know if it's the right way to do it but it even works
Hi,
I have the entire bundle loaded, and after my page load I am calling this on a wrapped set:
I am basically trying to restrict the input to either a decimal or percentage. I used an online regex tester to ensure it works: regex
And I've escaped the slashes in this fiddle, but I get strange behaviour: fiddle
Is this a bug or am I using it incorrectly?