We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 42601
    • 24 Posts
    I did for the form only, had 3 fields only, worked for 3 tests then stopped. 1 thing I notice is the first 2 boxes get entered back in once you hit submit when it fails. When it works all the form values disappear. Is there any debug tool that I could use that could help narrow down the fault...?
      • 42601
      • 24 Posts
      Stripped to its basic form:

      [[!FormIt?
      &hooks=`email, FormItSaveForm`
      &formName=`Contact Form`
      &emailTpl=`contactFormTpl`
      &store=`1`
      &emailTo=`[email protected]`
      &emailSubject=`New request from Sitename`
      &emailToName=`Support`
      &emailReplyTo=`[email protected]`
      &emailFrom=`[email protected]`
      &emailFromName=`Help Support`
      ]]
      <!-- Contact Form -->
      <form action="[[~[[*id]]]]" method="post" id="contact-form">
      <!-- Name Input -->
      <label for="full-name">Your full name</label>
      <input value="[[!+fi.full-name]]" id="full-name" name="full-name" type="text">
      <!-- End Name Input -->
      <!-- Name Input -->
      <label for="email">Your email address</label>
      <input value="[[!+fi.email]]" id="email" name="email" type="email" placeholder="[email protected]">
      <!-- End Name Input -->
      <!-- Name Input -->
      <label for="enquiry" class="g-font-weight-500 g-font-size-16">Your question</label>
      <textarea value="[[!+fi.enquiry]]" id="enquiry" name="enquiry"></textarea>
      <!-- End Name Input -->
      <button type="submit">Submit</button>
      <!-- End Contact Form -->


      I have a resource that points to the chunk with [[$form]] in the content section. Form being the name of the above code. [ed. note: thehaag last edited this post 8 years, 6 months ago.]
        • 17301
        • 932 Posts
        You're missing the closing </form> tag at the bottom - but I have this and can confirm it works:

        HTML

        [[!FormIt?
        &hooks=`email`
        &emailTpl=`contactFormTpl`
        &emailTo=`[email protected]`
        &emailSubject=`New request from Sitename`
        ]]
        
        <form action="[[~[[*id]]]]" method="post" id="contact-form">
        <input value="[[!+fi.full-name]]" id="full-name" name="full-name" type="text" placeholder="John Doe">
        <input value="[[!+fi.email]]" id="email" name="email" type="email" placeholder="[email protected]">
        <textarea value="[[!+fi.enquiry]]" id="enquiry" name="enquiry" rows="5" placeholder="Hi there, I would like to ..."></textarea>
        <button type="submit">Submit</button>
        </form>


        contactFormTpl

        [[+full-name]]
        <br><br>
        [[+email]]
        <br><br>
        [[+enquiry]]
        
          ■ 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.
          • 42601
          • 24 Posts
          Quote from: lkfranklin at Apr 11, 2018, 06:51 AM
          You're missing the closing tag at the bottom - but I have this and can confirm it works:

          HTML

          [[!FormIt?
          &hooks=`email`
          &emailTpl=`contactFormTpl`
          &emailTo=`[email protected]`
          &emailSubject=`New request from Sitename`
          ]]
          
          <form action="[[~[[*id]]]]" method="post" id="contact-form">
          <input value="[[!+fi.full-name]]" id="full-name" name="full-name" type="text" placeholder="John Doe">
          <input value="[[!+fi.email]]" id="email" name="email" type="email" placeholder="[email protected]">
          <textarea value="[[!+fi.enquiry]]" id="enquiry" name="enquiry" rows="5" placeholder="Hi there, I would like to ..."></textarea>
          <button type="submit">Submit</button>
          </form>


          contactFormTpl

          [[+full-name]]
          
          
          
          [[+email]]
          
          
          
          [[+enquiry]]
          

          I have a resource that points to the chunk with [[$form]] in the content section. Form being the name of the above code. I have even tried copying the form off the example. My next test it to try with a different template (modx default)
            • 17301
            • 932 Posts
            My advice would be to use a blank template until you're confident it's working and then start adding in a different surrounding markup and then eventually your own form additional markup.
              ■ 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.
              • 42601
              • 24 Posts
              Okay, ive even tried the base template. in the modx log i see: [FormIt] An error occurred while trying to send the email. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

              This comes up when it fails.
                • 17301
                • 932 Posts
                in system settings if you search for smtp do you have use smpto set to yes or no? If not, can you enter your smtp details and set to yes and see if you still get the issue?
                  ■ 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.
                  • 42601
                  • 24 Posts
                  Only 2 settings are set to NO

                  SMTP Keep-Alive
                  mail_smtp_keepalive
                  No

                  SMTP Single To
                  mail_smtp_single_to
                  No

                  is that the setting you're referring to? SMTP Single To?
                    • 17301
                    • 932 Posts
                    I was referring to the one that enables or disables smtp. If set to yes set it to no and see if problem persists. If set to no set it to yes and ensure smtp details are filled out correctly
                      ■ 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.
                      • 42601
                      • 24 Posts
                      Correct, the error no longer shows up in the Modx log. Form functions correctly as well data submits as well....