We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 33982 ☆ A M B ☆
    • 476 Posts
    So I’m attempting to call eForm in Ditto. Here’s my situation, I’ve got Ditto that outputs the info for each child doc and such plus it has a form for each child in the output. This is the basic structure here with the ID’s in parenthesis to illustrate what I’m trying to do:

    - Parent (13)

    -- Child (14)

    -- Child (15)

    -- Child (16)

    I’m attempting to put a form in each child output. I’ve got a site where I’m listing properties and if the visitor wants more info on the properties, they can fill out a form for that property. Generally this would be easy to do by just having the visitor go the page for that property and fill out the form, but we’re listing these forms in the ditto output with no link to that individual page (hope that makes sense). So we have multiple forms showing up on the same page. eForm requires each form have it’s own unique ID, so I thought I’d try this:

    [[Ditto? &parents=`13` &tpl=`properties_tpl`]]
    


    Then for "properties_tpl" I have this:

    [+pagetitle+]
    [!eForm? &formid=`EmailForm[+id+]` &subject=`Request Info for [+pagetitle+]` &to=`[email protected]` &tpl=`PropertyForm` &report=`ContactFormReport` &gotoid=`7`!]
    


    Then for the form I’ve got:

    <form method="post" action="[~[*id*]~]" id="EmailForm[*id*]" name="PropertyForm">
    <input name="formid" type="hidden" value="EmailForm[*id*]" />
    ........
    


    The value for "[*id*]" in eForm keeps coming back as the parent (in this case 13) which makes no sense to me. As such, the form won’t submit. Has anyone had eForm in their ditto output and with multiple forms being on the same page and been able to do it successfully?

    I’m using MODx 1.02 with eForm 1.4.4.6
      Precision Web Development ... SmashStack.com
      • 5340
      • 1,624 Posts
      try calling ditto uncached
        • 20413
        • 2,877 Posts
        Don’t think calling eForm inside Ditto works.

        I have an idea [untested]!
        Add &id=`abc` &save=`1` to the Ditto call, have the eForm outside ditto
        and get e.g.
        [+abc_id+] or
        [+abc_currentPage+] (with &paginate=`1`)
        to use in the eForm call/tpl id. This if you just going to display 1 item...

        Or use Ditto with request extender to get something to grab for... tricky.
        Maybe a snippet could identify / strpos() something of the showing ditto item.
        http://modxcms.com/forums/index.php/topic,46561.msg274314.html#msg274314
        http://modxdeveloper.com/blog/the-wrapper-snippet-run-a-snippet-from-within-another-snippet
          @hawproductions | http://mrhaw.com/

          Infograph: MODX Advanced Install in 7 steps:
          http://forums.modx.com/thread/96954/infograph-modx-advanced-install-in-7-steps

          Recap: Portland, OR (PDX) MODX CMS Meetup, Oct 6, 2015. US Bancorp Tower
          http://mrhaw.com/modx_portland_oregon_pdx_modx_cms_meetup_oct_2015_us_bancorp_tower