We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19815
    • 1 Posts
    Hi!
    I know that this topic isn't new, but I can't find valuable answer.
    Needs: save values in form fields after submit.
    What I have:

    • chunk (block-filter) where I place my filter form (there are select, text fields and a lot of checkboxes);
    • before this form i call FormIt snippet with param "store" set to 1;
    • before FormIt call I put FormItRetriever;
    Need to: save form fields values in the form on new page when I submit it!

    P.S. I know how it's can be realized with PHP, but maybe there's simple way! Thanks [ed. note: mksvs last edited this post 13 years, 2 months ago.]
      • 37589
      • 12 Posts
      Can you post your formit code, maybe there's a syntax error? Here is how I do it (basically)

      Formit Code:
      [[!FormIt?
      &hooks=`spam,email,FormItAutoResponder,redirect`
      &emailTpl=`formEmail`
      &emailTo=`[email protected]`
      &emailSubject=`Contact Form Submission - [[++site_name]]`
      &redirectTo=`6`
      &store=`1`
      &validate=`nospam:blank, name:required, email:email:required, comments:required:stripTags`]]


      Form data:
      <form class="form" action="[[~[[*id]]]]" method="post">
      [[+fi.error.error_message]] <input type="hidden" name="nospam" />
      
      [[+fi.error.name]]
      <label for="name"><strong>*</strong> Name: </label>
      <input id="name" type="text" name="name" value="[[+fi.name]]" />
      
      [[+fi.error.email]]
      <label for="email"><strong>*</strong> Email: </label>
      <input id="email" type="text" name="email" value="[[+fi.email]]" />
      
      [[+fi.error.comments]]
      <label for="comments"><strong>*</strong> Comments: </label>
      <textarea id="comments" name="comments" rows="2" cols="37">[[+fi.comments]]</textarea>
      <input type="submit" value="Submit" />
      </form>
      </div>
      

        • 16348
        • 64 Posts
        Maybe am I misunderstanding what you are doing but you don't need the FormItRetriever snippet on your page with the form. Call that snippet on the page the user is redirected to and the use the same placeholders that you used on the first page.
          • 42601
          • 24 Posts
          Im doing the same thing, the problem is QuickEmail reports email is succesful however formIt does not save the values nor does it email...

          The log does give: [2018-04-09 07:26:31] (ERROR @ /var/www/vhosts/3/120503/webspace/httpdocs/SITENAME/core/components/formit/model/formit/fihooks.class.php : 585) [FormIt] An error occurred while trying to send the email. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

          Any ideas?

          Here is my Tpl:
          name: contactFormTpl

          Chunk Code
          Full Name: [[+full-name]]


          Email Address: [[+email]]


          Enquiry: [[+enquiry1]]


          Additional Information: [[+additional]]

          Name:contact
          [[!FormIt?
          &hooks=`email, FormItSaveForm`
          &formName=`Contact Form`
          &emailTpl=`contactFormTpl`
          &store=`1`
          &emailTo=`[email protected]`
          ]]

          Sample of site values:

          <!-- Contact Form -->
          <form action="[[~[[*id]]]]" method="post" id="contact-form" class="u-shadow-v35 g-bg-white rounded g-px-40 g-py-50">
          <!-- Name Input -->
          <div class="row align-items-center mb-4">
          <div class="col-lg-4">
          <label for="full-name" class="g-font-weight-500 g-font-size-16">Your full name</label>
          </div>
          <div class="col-lg-8">
          <input value="[[!+fi.full-name]]" id="full-name" name="full-name" class="form-control g-brd-none g-bg-secondary g-bg-secondary-dark-v1--focus rounded g-px-20 g-py-12" type="text" placeholder="John Doe">
          </div>
          </div>
          <!-- End Name Input -->

          Any help or suggestions on how i could address this would be appreciated, thank you.

          Trev
            • 17301
            • 932 Posts
            It looks fine but you've only posted a sample of the code so it's not all that helpful. I would suggest start stripping everything back, even html and take it back to bare basics and slowly add back in until it breaks to help iscolate the problem.
              ■ email: [email protected] | ■ website: https://alienbuild.uk

              The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.
              • 3749
              • 24,544 Posts
              In my experience, the most common cause of FormIt email failing when QuickEmail succeeds is an invalid email from address. On many hosts, the email from address must have an email account at the host to be authorized to send outgoing email.

              People (including me) sometimes make the error of setting the "email from" address to the email of the person filling out the form. This makes sense since you may want to reply to that person, but they're not authorized to send mail from your server. The solution is to set the "mail from" to the emailsender system setting and add a "reply to" address containing the address of the user who filled out the form.

              A missing subject field is also a possibility.

              QuickEmail uses the value of the emailsender System Setting by default.
              [ed. note: BobRay last edited this post 8 years, 6 months ago.]
                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
                • 42601
                • 24 Posts
                Well, very frustrating.. if i refresh the page, resubmitting data the form works, same code!!!! Why do I need to refresh and resubmit the form for it to work, however, this does not happen everytime..... sometimes it works first go?????????????


                  • 3749
                  • 24,544 Posts
                  That's truly strange. I'm afraid I don't know what would cause that.

                    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
                    • 42601
                    • 24 Posts
                    Hmmm what a shame sad is there any alternative I could use other than Formit? I’ll try break it up into seperate chunks to see if that could be the issue as it does take a long time to ‘submit’.. thank you for the reply..
                      • 17301
                      • 932 Posts
                      Did you go through the process of stripping it back completely? Even to as a far as a blank template and just some basic formit calls? You may have some javascript blocking the submission, a browser extension, or a bunch of different reasons. Are you trying to email using the php mailer function or smtp?
                        ■ email: [email protected] | ■ website: https://alienbuild.uk

                        The greatest compliment you can give back to us, is to spend a few seconds leaving a rating at our trustpilot: https://uk.trustpilot.com/review/alienbuild.uk about the service we provided. We always drop mention of services offered by businesses we've worked with in the past to those of interest.