From a5f8253cff578da5380b8c9da2a5bcb5a366d9bc Mon Sep 17 00:00:00 2001 From: Suraj Savalia Date: Wed, 8 May 2013 18:50:03 -0400 Subject: [PATCH] Removes required attribute on all removed fields to allow Chrome submission --- vendor/assets/javascripts/jquery_nested_form.js | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) 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 });