Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

IndexFormat Of Main and indexFormat of Nested form are not replaced with index value #34

Open
sakthiemail opened this issue Feb 20, 2015 · 2 comments

Comments

@sakthiemail
Copy link

Index format of main form and nested form are not replaced index value with adding more than one form.The index value is being #index# for main form of nested form. Nested form index also be #index_format# How can i replace.
Please give any suggestion or support should be helpful.

@sakthiemail sakthiemail changed the title indexFormat Of Main and indexFormat of Nested form are not replaced with index value IndexFormat Of Main and indexFormat of Nested form are not replaced with index value Feb 20, 2015
@scottpederick
Copy link

Have a look at:
#8
Once you remove any special characters (ie. # and _) it works - just make it unique/loing enough it won't match anything else.

@jcrooke
Copy link

jcrooke commented Dec 8, 2016

Fix is as follows;

in the function normalizeFieldsForForm after;

form.find(formFields).each(function(){
                var that = $(this)
                    ,idTemplateAttr = getOrSetTemplate(that,"id")
                    ,nameTemplateAttr = getOrSetTemplate(that, "name")
                    ,idAttr = that.prop("id")
                    ,nameAttr = that.prop("name")

add the following two lines;

var idTemplateAttr = that[0]['id'];
var nameTemplateAttr = that[0]['name'];

That will ensure nested form fields will clone properly and won't screw up siblings.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants