We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7912
    • 21 Posts
    Hi,

    I’m writing a quiz for my site and I want to use eform to collect the data (though if there’s a better way I’d like to hear it). How can I get eForm to pass the results of the form to another snippet which will do the marking as opposed to it just emailing the results?

    If I was doing this outside MODx I’d do this <form action="results.php" method="post"> but of course MODx doesn’t work like that.
      • 4310
      • 2,310 Posts
      You could convert your results.php to a snippet call that snippet on a new page and post e-form to that new page.
      But I’m sure there are lots of other more elegant ways.
        • 6726
        • 7,075 Posts
        You sure can use eForm to build a quizz - it’s so versatile - but I guess you’ll need to store the data in a DB, then give a look at eForm2db

        Or maybe turn an existing quizz script into a MODx snippet smiley
          .: COO - Commerce Guys - Community Driven Innovation :.


          MODx est l&#39;outil id
          • 7455
          • 2,204 Posts
          or you can use my snippet that puts the input in a session and get them out again in the next page using sessions2placeholders

          http://modxcms.com/forums/index.php/topic,15350.0.html

          greets Dimmy
            follow me on twitter: @dimmy01
            • 6726
            • 7,075 Posts
            Wow cool resource how did I forget that shocked ?

            thanks Dimmy for reminding me grin
              .: COO - Commerce Guys - Community Driven Innovation :.


              MODx est l&#39;outil id
              • 7912
              • 21 Posts
              Hi, I’m probably doing something really stoopid but I’m getting the following error when using eform2session.

              Fatal error: Cannot redeclare eform2session() (previously declared in /homepages/23/d106304905/htdocs/flatbatteriesmodx/manager/includes/document.parser.class.inc.php(769) : eval()’d code:3) in /homepages/23/d106304905/htdocs/flatbatteriesmodx/manager/includes/document.parser.class.inc.php(769) : eval()’d code on line 5

              This is how I’m calling it:
              [[eform2session]]
              [!eForm? &eFormOnBeforeMailSent=`eform2session` &formid=`fb_quiz` &noemail=`1` &tpl=`quiz` &gotoid=`369`!]