jqueryhtmlvalidationmaskjquery-mask

jquery mask clean values on invalid


How can I make to jQuery accepts a wrong value in a field with a mask.

For the code bellow:

$("#element").mask("999.999.999-99");

If I put the value 444.444.44 on the field, on focus out the value will be cleaned.

There is a way to doesn't changes this value?


Solution

  • I found the answer!

    Just add "?" before the mask:

    $('#element').mask('?999.999.999-99');