2

I have tried, with no avail, to create a nestedForm inside of another nestedForm using the SheepIt! plugin. Is this even possible?

Extending Demo 7 on the SheepIt! website, I tried to add an additional nested form in JSFiddle

But I get a indexOf error...

Remove the following section to get rid of the error but break the intended functionality: JSFiddle

,
         nestedForms: [
        {
                id: 'person_addresses_#index#_phones_#index_phones#_tests',
                    options: {
                indexFormat: '#index_tests#'
            }
        }
         ]
jgrowl
  • 2,117
  • 2
  • 17
  • 23

2 Answers2

0

Here is the JSFiddle Solution

It seems that the SheepIt! plugin only likes to see one index in nestedForm ID. It was giving me the indexOf error because it was hitting the first #index#. You can still use multiple indexes in your inputs and it will fill them out as expected.

jgrowl
  • 2,117
  • 2
  • 17
  • 23
  • 1
    So it appears that this is not a complete solution. Creating 'tests' only works for the first address. – jgrowl Apr 06 '12 at 21:48
0

Add this line to function normalizeFieldsForForm after "that" declaration

var nameTemplateAttr = that[0]['name'];
Dinesh Patil
  • 1,042
  • 10
  • 13