jQuery Masked Input - Unmask Function


/ Published in: jQuery
Save to your folder(s)

Removes anything that isn't a digit from input on complete.


Copy this code and paste it in your HTML
  1. $("#PHONE1, #PHONE2, #FAX, #CELL").each(function() {
  2. $(this).mask("(999)999-9999", {
  3. completed : function () {
  4. $(this).val($(this).val().replace(/\D/g, "")).unmask();
  5. }
  6. });
  7. });

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.