diff --git a/vendor/assets/javascripts/jquery_nested_form.js b/vendor/assets/javascripts/jquery_nested_form.js index dcdbc8ac..32dec1d3 100644 --- a/vendor/assets/javascripts/jquery_nested_form.js +++ b/vendor/assets/javascripts/jquery_nested_form.js @@ -63,13 +63,14 @@ removeFields: function(e) { var $link = $(e.currentTarget), assoc = $link.data('association'); // Name of child to be removed - + var hiddenField = $link.prev('input[type=hidden]'); hiddenField.val('1'); - + var field = $link.closest('.fields'); field.hide(); - + field.find('*').removeAttr('required'); + field .trigger({ type: 'nested:fieldRemoved', field: field }) .trigger({ type: 'nested:fieldRemoved:' + assoc, field: field });