We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 40045
    • 534 Posts
    I have the following situation:

    1) A complex form in a chunk with the FormIt Snippet call in it too, so I can handle the whole form with a [[!$form_chunk]]

    2) When filling out the form, the user can add (or not) a desired amount of additional fields, which are inserted in the DOM via jQuery

    3) The form gets submitted via AJAX (jQuery .load() function...) to the page the form is on --> URL for the load function gathered with window.location / $(location).attr(’href’), and after returning the whole DOM of the page I extract only the form part I need and insert it back into the page

    4) When the form is emailed, the successMessage is loaded

    This works as expected, form is successfully submitted via ajax and formit mails to my address


    The problem I have is in the emailTpl property. When I leave it empty, all the fields (the later added/dynamic ones too) are listed in the sent mail, but when I add the template chunk, only the those fields are sent for which I have a placeholder inside the emailTpl chunk...this is the expected behaviour but it gives me some headache because I couldn’t find a solution to output the dynamically generated fields as I would like to...I tried it with a Snippet inside the emailTpl chunk, but as it seems, Snippets don’t get parsed in there, so I just received the set placeholders and the Snippet shown in form of [[!Snippetname]] inside the email...

    The idea was, that if I could access the $fields array inside the emailChunk, I could maybe handle the dynamic fields somehow because they are there (as the example with no tpl Chunk shows)...but I’m really getting nowhere so I thought I’ll ask here =).


    Any ideas how to solve this problem?

    Thanks for any answers!
      • 40045
      • 534 Posts
      Is there Really no way to execute a snippet inside the emailTpl? It would be ok if I could use the [[If]] snippet^^...


      or a way to remove non-existing placeholders btw. replace them with nothing??
        • 29076
        • 615 Posts
        Quote from: lluuuk at Jun 10, 2011, 07:50 PM

        Is there Really no way to execute a snippet inside the emailTpl?
        Same question from me to. smiley
          I think, thererfor I am! But what I am, and why...?