demarches-normaliennes/app/assets/javascripts/new_design/form_validation.js
2017-09-06 11:11:30 +02:00

8 lines
276 B
JavaScript

$(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');
});