Remove literals from input mask after form submit?

Wednesday Man picture Wednesday Man · Oct 21, 2011 · Viewed 40.5k times · Source

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?

Answer

Alex Peattie picture Alex Peattie · Oct 21, 2011

I think you want to use unmask

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