13 lines
284 B
JavaScript
13 lines
284 B
JavaScript
|
$(document).on('turbolinks:load', function() {
|
||
|
$('#submit-post').click(function(e) {
|
||
|
var form = $(this).parents('form.form');
|
||
|
|
||
|
if (form[0].checkValidity() === false) {
|
||
|
e.preventDefault();
|
||
|
e.stopPropagation();
|
||
|
}
|
||
|
|
||
|
form.addClass('was-validated');
|
||
|
});
|
||
|
});
|