demarches-normaliennes/app/javascript/new_design/form-validation.js

9 lines
268 B
JavaScript
Raw Normal View History

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