andyferra/nested-forms — pull request #1 by vsanta (2012-06-28 20:51:55+00:00)
Title: input's name treated as required

Hello,

I'm using a plugin (select2) in one of my inputs that adds a new input for a autocomplete search. This new input generated by the plugin doesn't have a name property. This causes nested form js to crash when trying to rename the cloned input because it treats the name attribute as required.

So my solution was to by pass any input that doesn't have a name when cloning the form since according to W3C "Only form elements with a name attribute will have their values passed when submitting a form."

That way nested_forms still works for all field that are actually submitted and the user is responsible for setting up any non submittable components using the after_add callback.