mirror of
https://0xacab.org/sutty/sutty
synced 2025-01-19 20:33:38 +00:00
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');
|
var form = $(this).parents('form.form');
|
||||||
|
|
||||||
if (form[0].checkValidity() === false) {
|
if (form[0].checkValidity() === false) {
|
||||||
|
|
|
@ -18,7 +18,7 @@
|
||||||
= form_tag url, method: method, class: 'form', novalidate: true, multipart: true do
|
= form_tag url, method: method, class: 'form', novalidate: true, multipart: true do
|
||||||
= hidden_field_tag 'template', params[:template]
|
= hidden_field_tag 'template', params[:template]
|
||||||
.form-group
|
.form-group
|
||||||
= submit_tag t('posts.save'), class: 'btn btn-success'
|
= submit_tag t('posts.save'), class: 'btn btn-success submit-post'
|
||||||
.form-group
|
.form-group
|
||||||
= label_tag 'post_dir', t('posts.dir')
|
= label_tag 'post_dir', t('posts.dir')
|
||||||
= select_tag 'post[dir]',
|
= select_tag 'post[dir]',
|
||||||
|
@ -98,4 +98,4 @@
|
||||||
= render "posts/template_field/#{type}", template: template, name: template.key, value: value
|
= render "posts/template_field/#{type}", template: template, name: template.key, value: value
|
||||||
.invalid-feedback= t('posts.invalid')
|
.invalid-feedback= t('posts.invalid')
|
||||||
.form-group
|
.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