Created
February 2, 2018 21:03
-
-
Save phsacramento/4ed8a816371e0d33e1e7da03a10fff83 to your computer and use it in GitHub Desktop.
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
var formatForm = function(){ | |
var that = this; | |
this.$form = $('form'); | |
this.startup = function(){ | |
if(!this.$form[0]){ return false; } | |
this.$form.find('input.tel').mask("(99) 9?9999-9999"); | |
this.$form.find('input.cep').mask("99999-999"); | |
this.$form.find('input.cpf').mask("999.999.999-99"); | |
this.$form.find('input.cnpj').mask("99.999.999/9999-99"); | |
this.$form.find('input.hour').mask("99:99"); | |
this.$form.find('input.date').mask("99/99/9999"); | |
this.$form.find('.datepicker').datepicker(); | |
} | |
this.startup(); | |
} | |
jQuery(document).ready(function($) { | |
new formatForm(); | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment