-
-
Save pavlo-bondarchuk/bcad6ce2f3836d0ffad2509ae44b3da3 to your computer and use it in GitHub Desktop.
unmask onclick masked input
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<script type="text/javascript"> | |
$(function($) { | |
$("#OfficePhone").mask("(999) 999-9999? x99999"); | |
$("#InternationalOfficePhone").click(function() { | |
var mask = "(999) 999-9999? x99999"; | |
if ($("#InternationalOfficePhone").is(':checked')) { | |
$("#OfficePhone").unmask(mask); | |
} else { | |
$("#OfficePhone").mask(mask); | |
} | |
}); | |
}); | |
</script> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment