jQuery Masked Input (digitalBush) doesn't work with Chrome 19 input type="number"

2.4k Views Asked by At

I am trying to use jQuery Masked Input (from digitalBush) without success. My HTML code is:

<input class="numeric float optional" id="ocorrencia_altura" min="0" name="ocorrencia[altura]" step="any" type="number">

And my Javascript code is:

$("#ocorrencia_altura").mask("9,99");

It works fine in Firefox 12 (field without spins (HTML5 input type=number)) but doesn't work with Chrome 19, where the input has spins. I can't even insert a number in Chrome (In text fields it works). How could I fix this?

1

There are 1 best solutions below

0
On

Try adding a ? at the start of the mask specifier:

$("#ocorrencia_altura").mask("?9,99");