jquerypluginsmaskmaskedinput

Remove literals from input mask after form submit?


this question has already been asked but the solutions where not clear.

Im using Josh Bush's MaskedInput plugin for jQuery

What im trying to achieve is:

E.g: a phone input with the mask

    $("#txtPhone").mask("(99)9999-9999");

EQUALS: (00)9398-8373

i want it to submit : 0093988373

------ Is it possible to remove the .mask on submit but keep the value?


Solution

  • I think you want to use unmask

    $("#myForm").submit(function() {
      $("#txtPhone").unmask();
    });