Skip to content
Browse files

On addition or removal of nested fields, try to validate the whole fo…

…rm again. Does not seem to work :(
  • Loading branch information...
1 parent e390881 commit 58c5d4a85379e1d3de2198e88b986b64e27072d8 @nathanvda committed
Showing with 13 additions and 0 deletions.
  1. +13 −0 app/assets/javascripts/application.js
View
13 app/assets/javascripts/application.js
@@ -10,3 +10,16 @@
//= require rails.validations
//= require rails.validations.formtastic
//= require_tree .
+
+$(document).ready(function() {
+ $('#tasks').bind('insertion-callback',
+ function() {
+ alert('task added!!');
+ $('form[data-validate]').validate();
+ });
+ $('#tasks').bind("after-removal-callback",
+ function() {
+ alert('task removed!!');
+ $('form[data-validate]').validate();
+ });
+});

0 comments on commit 58c5d4a

Please sign in to comment.
Something went wrong with that request. Please try again.