Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery Masked Input - Existing Input Value

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.

like image 764
plippard Avatar asked May 27 '11 01:05

plippard


1 Answers

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.

like image 195
Leandro Avatar answered Oct 23 '22 20:10

Leandro