We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25422
    • 11 Posts
    I have a form in my website with firstname field,while submitting the form,the thankyou message should be displayed in another page and not in the same page where there is the form,I have done it but the problem is ,I couldn’t get the firstname in the other page,Can anybody help me,...

      • 3749
      • 24,544 Posts
      You could try SPForm (which does that automatically) or eForm, which will do it with some configuration.

      Otherwise, you’d need to put something like this in the code that processes your form:

      (off the top of my head, might not be quite right)

      $url = $modx->makeURL(id_of_thankyou_page);
      $modx->sendRedirect($url);
        Did I help you? Buy me a beer
        Get my Book: MODX:The Official Guide
        MODX info for everyone: http://bobsguides.com/modx.html
        My MODX Extras
        Bob's Guides is now hosted at A2 MODX Hosting
      • It would help if you gave more information. What form are you using? The snippet call you use as well as any tpl chunks you use would also be helpful.
          Studying MODX in the desert - http://sottwell.com
          Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
          Join the Slack Community - http://modx.org
          • 25422
          • 11 Posts
          I have created a chunk where the form is displayed, then I have a snippet to store the details..

          It is an ordinary registration form,I have used the below code

          [!downloadForm!][!eForm? &to=’[+emailaddress+]’ &formid=`downloadForm` &eFormOnBeforeMailSent=`downloadForm` &tpl=`downloadForm` &gotoid=`16` &report=`downloadFormReport_latest` &subject=`Activation mail` &cc=`1`!]

          Here i have given " gotoid=`16` ",So when the form submits it gets diverted to the corresponding page(ie, with id =16) ,the problem is ,I need the value that is given in the form to be displayed in this page [ie,id=16]

          Any luck??

          • Is there a particular reason why the submitter needs to be sent to document #16? If you use a &thankyou tpl you can use the same document, only it will display your thankyouTpl chunk and you can use the placeholders.
              Studying MODX in the desert - http://sottwell.com
              Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
              Join the Slack Community - http://modx.org
              • 25422
              • 11 Posts
              Yes,actually in the page where Registration form is,there is some contents,I dont want that contents to get displayed when the form is submitted,that’s why I used this alternative...

              Any,what is Placeholders mean?
              • Make that content part of your form template? Basically, your form page would have two states, one for displaying the form and any accompanying content, and the other for after the form is submitted. And a third tpl chunk, of course, for your emailed report.

                Placeholders are the [+...+] elements that you can use. The eForm snippet sets them, then MODx has them available to insert wherever the [+...+] tags are. For the report and thankyou chunks, as well as error messages, they’re taken from the POST.
                  Studying MODX in the desert - http://sottwell.com
                  Tips and Tricks from the MODX Forums and Slack Channels - http://modxcookbook.com
                  Join the Slack Community - http://modx.org