We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 23377
    • 5 Posts
    Hi everybody,
    i have a question about using eform split in multiple forms:
    Is it possible to "link" to a document instead of a chunk? The first form part is placed on the "start" page of my projekt which uses a different template than the following pages. The second form part should be displayed in a document using another template.

    Thank you for any help
      • 727
      • 502 Posts
      You could try this:

      A small eform on the first document with the start of your form.
      When you click on Submit it POSTs the data to the second document.
      On the second document you have a multi "page" eform, where the first "page" is identical to the small eform on the first document.
      When the second document is loaded, somehow automatically submit the form to skip the first "page", so the user doesn’t have to complete that part twice (even though the data will already have been filled in).

      or:

      A small eform on the first document with the start of your form.
      When you click on Submit it POSTs the data to the second document.
      On the second document you have a mutli "page" eform, where the first "page" contains hidden fields for the data already submitted by the user on the first document. The visible part of the form contains the second set of data the user needs to enter.

      Andy
        • 21191
        • 236 Posts
        I’ve followed this guide, and it’s going well. However, I have a 7 step, detailed form. Is there a way to automatically parse through the form? Like formMail.pl does?

        http://fmmc.com/test-application

        Otherwise I have a ton of php to hackup .. and this solution would make the code reusable for other multipage forms on a site.

        thanks.
          ~Shawn Himmelberger
          Check out my MODx Development and MODx Design Company - Himmelberger Design
          • 727
          • 502 Posts
          Why would you want to use formmail.pl? As far as I can see it parses a form and emails the result, which is exactly what eform does. They appear to be mutually exclusive.

          BTW you spelled Permanent incorrectly.

          Andy
            • 21191
            • 236 Posts
            Andy, I used formail.pl as an example of a functionality. in form mail you don’t have to make an "email" template, but I don’t think it wil do multi-pagg stff.

            Anyway, see in the php snippet in this guide, you have to create variables and place holders for each form input ID, to hold it though seperate steps, I have close to a hundred total input fields (feels like it anyway), so can it parse through the form data and generate that code on the fly, rather than have a mess of php for each form you want to use.

            also, spelling nor typing is my strong suit.

            -shawn
              ~Shawn Himmelberger
              Check out my MODx Development and MODx Design Company - Himmelberger Design
              • 727
              • 502 Posts
              I’m sure it’s possible to generate the templates on the fly. All you need to do is create a plugin or module that can write the necessary templates/snippets to the database. But you still would have to tell your template generator what to put on each page. I guess this would only be effective with a large number of very similar forms.

              Andy
                • 21191
                • 236 Posts
                OR effective with lazy people like me, I’m they type who would rather work twice as hard once, and be lazy the rest of the time, the main reason why I like MODx so much.

                but it’s not so much the template, but the conditional code example:
                 case 2: //save values in session
                      $_SESSION['address']= $fields['address'];
                      $_SESSION['town']= $fields['town'];
                      $_SESSION['formStep'] = 3; //prepare next step
                    break;

                in my instance, I have 7 of these cases, each with 10 or more variables... it’s just a pain .. by now I could have codded it all. But the main issue is, what about the next time? would it not be better to have a code snippet that would just store all info it gets, assign variables to placeholders, regardless of how many steps? And then fire it all off when it gets the "go" variable on the last step.

                just my $.02
                  ~Shawn Himmelberger
                  Check out my MODx Development and MODx Design Company - Himmelberger Design
                  • 727
                  • 502 Posts
                  I think it probably could be simplified here and there. Please post back your improvements. smiley How often will your large forms change?

                  Andy
                    • 27376
                    • 576 Posts
                    You could just have a single [tt]$_SESSION[/tt] variable store the entire [tt]$fields[/tt] variable, and then on all subsequent steps, call [tt]array_merge()[/tt] to update the [tt]$_SESSION[/tt] variable and then increment the step. Is that the kind of solution you’re looking for?
                      • 21191
                      • 236 Posts
                      I hope it will smiley

                      I’m full of ideas but lacking on know-how ... would you mind inserting that idea in the code?

                      THANKS!
                        ~Shawn Himmelberger
                        Check out my MODx Development and MODx Design Company - Himmelberger Design