We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 4385
    • 372 Posts
    I have a short form that send an email, that I would like to redirect to a longer version of the form with the the previous information pre-filled out.

    I tried referring to the fields in the chunk but had no luck, I also tried using session. What would be the best way to do this?
      DropboxUploader -- Upload files to a Dropbox account.
      DIG -- Dynamic Image Generator
      gus -- Google URL Shortener
      makeQR -- Uses google chart api to make QR codes.
      MODxTweeter -- Update your twitter status on publish.
      • 30223
      • 1,010 Posts
      Have a look at this example and alter it to your needs...

      http://modxcms.com/forums/index.php/topic,8572.0.html
        • 4385
        • 372 Posts
        Thanks Toby, I was trying to do something simpler.

        I have a mini form on the first page, to capture name and email. I want to email the info to me, then on the thank you page have a more in-depth form to collect additional information.
        I ask name and email again, and want to pre-populate the fields again.

        Here is what I have...

        I tried this, and the placeholders are passed, but the template doesn’t change
        [!eForm? &formid=`QuizForm` &subject=`Web Contact` &to=`[email protected]` &tpl=`miniq` &report=`quizReport` &thankyou=`28` !]

        The template changes, but does not populate the placeholders
        [!eForm? &formid=`QuizForm` &subject=`Web Contact` &to=`[email protected]` &tpl=`miniq` &report=`quizReport` &gotoid=`28` !]

        This is on doc 28, my thank you page

        <input id="txtFirst" maxlength="50" name="txtFirst" tabindex="0" type="text" value="[+formFirst+]" />



        Any ideas?




          DropboxUploader -- Upload files to a Dropbox account.
          DIG -- Dynamic Image Generator
          gus -- Google URL Shortener
          makeQR -- Uses google chart api to make QR codes.
          MODxTweeter -- Update your twitter status on publish.
          • 30223
          • 1,010 Posts
          Hmm, I’ve never tried this but possibly this could work.

          On the original (first) eform form use the eFormOnMailSent event to store the values in the session. For instance
          function onBeforeMailSent( &$fields){
              $_SESSION['eform_name] = $fields['name'];
              $_SESSION['eform_email] = $fields['email'];
          
              return true;
          }
          

          On the &gotoid page create a new eForm call with a different formid and template and use the &sessionVars to import the session values.
          [!eForm? &formid=`different_form` &tpl=`different_template` &sessionVars=`eform_name,eform_email` ...!]
          

          In your second template you would have these fields with a placeholder...
          ...
          <input name="name" type="text" value="[+eform_name+]" eform="Your Name::1"/>
          ...
          <input  name="email" type="text" value="[+eform_email+]" eform="Your email Address:email:1" />
          ...


          AsI said, I’ve never tried this, but give it a go....