Skip to content

Instantly share code, notes, and snippets.

@phsacramento
Created February 2, 2018 21:03
Show Gist options
  • Save phsacramento/4ed8a816371e0d33e1e7da03a10fff83 to your computer and use it in GitHub Desktop.
Save phsacramento/4ed8a816371e0d33e1e7da03a10fff83 to your computer and use it in GitHub Desktop.
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