demarches-normaliennes/app/assets/javascripts/new_design/form_validation.js

9 lines
276 B
JavaScript
Raw Normal View History

$(document).on('blur keydown', 'input, textarea', function() {
$(this).addClass('touched');
});
$(document).on('click', 'input[type="submit"]:not([formnovalidate])', function() {
var $form = $(this).closest('form');
$('input, textarea', $form).addClass('touched');
});