mdelrosso / sheepit

SheepIt! Form Cloning plugin for Jquery
http://www.mdelrosso.com/sheepit/
MIT License
68 stars 44 forks source link

Nested Form Data Injection not working #20

Open anant254 opened 11 years ago

anant254 commented 11 years ago

Data is not injected in the nested forms. Even in example7, given on the website, data is not injected into the nested form (checked on chrome 26 and FF 20) sheepit-nestedforminjection-bug .

dkulkarni commented 11 years ago

Yup I face this issue too!

moizshabbir commented 10 years ago

I solved this issue by commenting following lines in getOrSetTemplate function

//          if(template) {
//            return unescape(template);
//          }

and by changing following code in fillForm function

// Replace form Id and form Index with current values
                if (index.indexOf('#form#') != -1 || index.indexOf('#index#') != -1) {
                    index = index.replace('#form#', formId);
                    index = index.replace('#index#', formIndex);
                } else {
                    index = formId + '_' + formIndex + '_' + index;
                }

to

var iFormat = '#index#';
        if(options.indexFormat != undefined && options.indexFormat){
            iFormat = options.indexFormat;
        }

                // Replace form Id and form Index with current values
                if (index.indexOf('#form#') != -1 || index.indexOf(iFormat) != -1) {
                    index = index.replace('#form#', formId);
                    index = index.replace(iFormat, formIndex);
                } else {
                    index = formId + '_' + formIndex + '_' + index;
                }

Used sheepit version 1.1.1.

cronida commented 10 years ago

¡Thanks @moizshabbir !

mukti107 commented 8 years ago

it helped, thanks

dinzy17 commented 8 years ago

Thanks alot.. It helped me too :)