Created
June 2, 2014 19:10
-
-
Save jonasporto/ed84e3852960f83c9c8d 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
$('.field-required').on('invalid', function() { | |
var textfield = $(this).get(0); | |
var msg = $(this).attr('msg') || 'O preenchimento deste campo é obrigatório'; | |
textfield.setCustomValidity(''); | |
if (!textfield.validity.valid) { | |
textfield.setCustomValidity(msg); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment