• Resolved vanian

    (@vanian)


    Great plugin, looking forward to the Pro version. The only issue I’ve encountered comes when attempting to duplicate (clone) a block of content that has conditions based on class names. Only the first block will continue to work; new cloned content does not function as expected.

    Is this a known issue? I imagine this is just a matter of traversing the DOM to find the closest relevant hidden content, but perhaps I am not using this properly.

    Thank you.

Viewing 4 replies - 1 through 4 (of 4 total)
  • Thread Starter vanian

    (@vanian)

    Quick update to this, turns out that bindings weren’t being preserved – adjusting code to following solves this, but now ALL of the duplicated fields are being shown on click of one checkbox in one block (ideally, just the one relevant hidden field will display).

    $('.my-block:first').clone(true, true);

    Plugin Author Jules Colle

    (@jules-colle)

    if you are writing your own jQuery code to clone groups, you might as well uninstall the conditional fields plugin and simply code the logic to show/hide groups in your jQuery code.

    Cloning fields will give errors if you are using CF7. CF7 expects the fields it receives during the POST request to be the ones you entered in the back end. Adding and changing field names on the front-end will break CF7’s default functionality. You will end up writing a lot of extra code, and wrting hooks to CF7. Might be a good idea to entirely drop CF7 for this problem and code your own form from scratch.

    Thread Starter vanian

    (@vanian)

    Thanks for your quick response. I went ahead and rolled my own; appreciate your insight.

    Plugin Author Jules Colle

    (@jules-colle)

    you’re welcome!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Cloning Divs with Conditional content’ is closed to new replies.