Last active
November 10, 2015 11:07
-
-
Save RafaPegorari/89e39e9bbe785cbce662 to your computer and use it in GitHub Desktop.
validate.js
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
$.validator.setDefaults({ | |
debug: !0, | |
errorClass: "has-error", | |
highlight: function (a, b) { | |
$(a).closest("div").addClass(b); | |
}, | |
unhighlight: function (a, b) { | |
$(a).closest("div").removeClass(b); | |
} | |
}); | |
$.extend($.validator.messages, { | |
required: "Obrigatório", | |
remote: "Corrija este campo", | |
email: "E-mail inválido", | |
url: "Url inválida", | |
date: "Data inválida", | |
dateISO: "Data inválida (ISO)", | |
number: "Número inválido", | |
digits: "Somente dígitos", | |
creditcard: "Cartão inválido", | |
equalTo: "Forneça o mesmo valor", | |
extension: "Extensão inválida", | |
maxlength: $.validator.format("Não mais que {0} caracteres"), | |
minlength: $.validator.format("Ao menos {0} caracteres"), | |
rangelength: $.validator.format("Deve conter entre {0} e {1} caracteres"), | |
range: $.validator.format("Deve conter entre {0} e {1} ."), | |
max: $.validator.format("Menor ou igual a {0} "), | |
min: $.validator.format("Maior ou igual a {0} ") | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment