Closed mquispe1185 closed 6 years ago
Hi,
for normal forms, CSV should work out of the box.
Please provide all the information requested in the issue report template
Closing here, please start a new one and answer all the questions
HI, excuse me my english is bad, what do you refer to "out of the box"? which is the box in the form or modal?. thanks for reply
2018-01-12 6:58 GMT-03:00 Geremia Taglialatela notifications@github.com:
Hi,
for normal forms, CSV should work out of the box.
Please provide all the information requested in the issue report template
Closing here, please start a new one and answer all the questions
— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub https://github.com/DavyJonesLocker/client_side_validations/issues/730#issuecomment-357194725, or mute the thread https://github.com/notifications/unsubscribe-auth/AZNy4bgVgNd2ffvrPczHAGDbOfGAmzQzks5tJyzdgaJpZM4Rbrzg .
-- Matias E. Quispe
@mquispe1185 it should work without just by following the readme. You don't need extra javascript to make it work
yes, the gem works perfec in normal form, but not in modal, i add to my aplication.js this: $(document).on('turbolinks:load', function(){
$('.modal').on('shown.bs.modal', function() {
$('form[data-client-side-validations]').enableClientSideValidations(); }); }); but csv is not working on modal. please help me. Also the issue could be in the way I call the modal. this is my link in the readme, there is no help for modal implementation
2018-01-12 11:35 GMT-03:00 Geremia Taglialatela notifications@github.com:
@mquispe1185 https://github.com/mquispe1185 it should work without just by following the readme. You don't need extra javascript to make it work
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DavyJonesLocker/client_side_validations/issues/730#issuecomment-357253885, or mute the thread https://github.com/notifications/unsubscribe-auth/AZNy4VXoDJKBQ8UR3hiQq_szZrEL8_e_ks5tJ22kgaJpZM4Rbrzg .
-- Matias E. Quispe
Hi, for modals you need to follow the wiki.
Please use idempotent events as described here: https://github.com/DavyJonesLocker/client_side_validations/wiki/Bootstrap-Modal-Validations
I've just added a javascript version of the coffee listener
I am using Turbolinks where should add ? this way is correct? $(document).on('turbolinks:load', function(){
$(document).on('shown.bs.modal', '.modal', function() { $('form[data-client-side-validations]').enableClientSideValidations(); });
}); });
2018-01-12 13:34 GMT-03:00 Geremia Taglialatela notifications@github.com:
Hi, for modals you need to follow the wiki.
Please use idempotent events as described here: https://github.com/ DavyJonesLocker/client_side_validations/wiki/Bootstrap-Modal-Validations
I've just added a javascript version of the coffee listener
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/DavyJonesLocker/client_side_validations/issues/730#issuecomment-357284351, or mute the thread https://github.com/notifications/unsubscribe-auth/AZNy4Vuu1iXOtopHaKh5m9i35WGe1rKiks5tJ4bugaJpZM4Rbrzg .
-- Matias E. Quispe
I am using Turbolinks where should add ? this way is correct?
Nope.
Idempotent events should not be wrapped inside $(document).on('turbolinks:load', function(){
This is enough
$(document).on('shown.bs.modal', '.modal', function() {
$('form[data-client-side-validations]').enableClientSideValidations();
});
Please make sure that your modals have the .modal class and that this function is being called (put a breakpoint or an old fashioned console.log)
I can show validations messages correctly in a normal form but NOT IN MODAL FORM. the solutions in the wiki seems not to work in rails 5.0 as they show a solution for Rails 5.1. this are my gems client_side_validations (11.0.0) client_side_validations-simple_form (6.5.0) rails (5.0.6, 5.0.3, 5.0.2) bootstrap-sass (3.3.7)
this is my aplication.js `$(document).on('turbolinks:load', function(){
//HERE I SHOULD ADD SOME CODE the solution in the wiki is coffescript I need a solution in js and how to add it here.
});``this is my form:
<div
class="modal-content" id="modal_usuario"> <div class="modal-header"> <button type="button" class="close" data-dismiss="modal" aria-hidden="true">×</div>
[<div] class="modal-body"> <%= simple_form_for(@usuario, html: {class: "miform form-horizontal"}, validate: true) do |f| %>Nuevo Usuario
<%= f.error_notification %>
--- some extra code---