validar el formulario en ambos botones
This commit is contained in:
parent
97b2f7c87d
commit
b79bc1735f
2 changed files with 3 additions and 3 deletions
|
@ -6,7 +6,7 @@ $(document).on('turbolinks:load', function() {
|
|||
}
|
||||
});
|
||||
|
||||
$('#submit-post').click(function(e) {
|
||||
$('.submit-post').click(function(e) {
|
||||
var form = $(this).parents('form.form');
|
||||
|
||||
if (form[0].checkValidity() === false) {
|
||||
|
|
|
@ -18,7 +18,7 @@
|
|||
= form_tag url, method: method, class: 'form', novalidate: true, multipart: true do
|
||||
= hidden_field_tag 'template', params[:template]
|
||||
.form-group
|
||||
= submit_tag t('posts.save'), class: 'btn btn-success'
|
||||
= submit_tag t('posts.save'), class: 'btn btn-success submit-post'
|
||||
.form-group
|
||||
= label_tag 'post_dir', t('posts.dir')
|
||||
= select_tag 'post[dir]',
|
||||
|
@ -98,4 +98,4 @@
|
|||
= render "posts/template_field/#{type}", template: template, name: template.key, value: value
|
||||
.invalid-feedback= t('posts.invalid')
|
||||
.form-group
|
||||
= submit_tag t('posts.save'), class: 'btn btn-success', id: 'submit-post'
|
||||
= submit_tag t('posts.save'), class: 'btn btn-success submit-post'
|
||||
|
|
Loading…
Reference in a new issue