I am using jQuery masked input plugin. However when I set the mask, any existing value in the input field is being destroyed. Doing the following:
$(".priceSKUID").mask("**-***-******", { placeholder: " " });
There must be a way to deal with existing values which are programmatically placed into the input field.
When you set a mask like 9999, the value of the input has to be 9999. But, if we have a mask with some optional characters like 9?999, it means that if the value have just one character, it will be displayed. In other words, the last three characters are opitional. I just tried it and works fine.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With