We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Formit stopped working on my website. I installed Quickemail and sending mails seems to be working fine. I don't see what is wrong.

    This is the Formit code:

    [[!FormIt?
    &hooks=`spam,email,redirect,FormItAutoResponder`
    &submitVar=`contactForm-submit`
    &emailTpl=`form-contact-sentEmailTpl`
    &emailSubject=`Een bericht van [[+contact_name]]`
    &emailTo=`[email protected]`
    &validate=`
          workemail:blank,
          contact_name:required:minLength=`2`,
          email:email:required,
          contact_telefoon:required,
          contact_message:required`
    &redirectTo=`39`
    &fiarTpl=`form-contact-autoResponse`
    &fiarSubject=`Je bericht`
    &fiarToField=`email`
    &fiarFrom=`[email protected]`
    &fiarFromName=`Afzendernaam`
    ]][[+fi.error.error_message]]
    
    <form id="contactForm" class="cmxform" method="post" action="[[~[[*id]]]]">
    <input type="hidden" name="contactForm-submit">
    <input type="hidden" name="workemail" value="" />
    [[!+fi.validation_error_message:notempty=`
    <div class="error">
        <strong>Het invullen van het formulier ging niet goed. Controleer de velden.</strong>
    </div>`]]
    <div class="form-group required">
    <label for="contact_name" class="control-label">Naam: *<br />
    <input type="text" id="contact_name" name="contact_name" class="required form-control" value="[[!+fi.contact_name]]" /> [[!+fi.error.contact_name]]</label> 
    </div>
    <div class="form-group">
    <label for="contact_telefoon" class="control-label">Telefoonnummer: </label> *<br />
    <input type="tel" id="contact_telefoon" name="contact_telefoon" class="form-control"  size="11" value="[[!+fi.contact_telefoon]]" /> [[!+fi.error.contact_telefoon]]
    </div>
    <div class="form-group">
    <label for="email" class="control-label">E-mailadres: </label> *<br />
    <input type="email" id="email" name="email" class="email form-control" value="[[!+fi.email]]" /> [[!+fi.error.email]]
    </div>
    <div class="form-group required">
      <label for="contact_message" class="control-label">Je vraag of bericht: [[!+fi.error.contact_message:notempty=`<br />[[!+fi.error.contact_message]]`]]</label> *<br />
      <textarea id="contact_message" name="contact_message" rows="7" class="form-control"></textarea>
    </div>
    <div class="form-buttons">
        <input name="contactForm-submit" class="submit btn btn-primary" type="submit" value="Verzenden"/>
    </div>
    </form>

    This question has been answered by handjes. See the first response.

      • 17301
      • 932 Posts
      I tested it on a blank template and removed the formitautoresponder and can confirm its working ok for me - haven't tried it with autoresponder though.

      Try stripping it back using a blank template and strip it back to bare basics. Slowly add in formitautoresponder, validation and everything else until it breaks.
        ■ 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.
        • 22840
        • 1,572 Posts
        Not sure if it's the issue but you are missing the "fiarReplyTo" property which is required

        https://docs.modx.com/extras/revo/formit/formit.hooks/formit.hooks.formitautoresponder
        • Thanks. But still no luck.

          Since when is fiarReplyTo required? I never used it before and forms on other sites work fine without.
            • 38783
            • 571 Posts
            Did Formit stop working without any other changes taking place on the site?

            If it did is anything showing up in the MODX error logs, or in your servers php logs?

            Has the version of php, (or anything else) been updated on the server recently?

            What version of MODX and Formit are you using?
              If I help you out on these forums I would be very grateful if you would consider rating me on Trustpilot: https://uk.trustpilot.com/review/andytough.com

              email: [email protected] | website: https://andytough.com
              • 17301
              • 932 Posts
              Your form isn't working even when you just have a blank template a basic formit call with no validation and no hooks except email? It'll be a server issue in that case.
                ■ 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.
              • I'm not sure when Formit stopped working. We added extra contexts. Which reminded me to look at the htaccess...

                I changed this:
                RewriteCond %{HTTP_HOST} !^www\.domainname\.nl [NC]
                RewriteRule (.*) https://www.domainname.nl/$1 [R=301,L]

                To:
                RewriteCond %{HTTP_HOST} ^(?!www\.)(.+) [NC
                RewriteRule ^(.*) http://www.%1/$1 [R=301,NE,L]

                Now it looks the form is processed! But it renders an error: Page isn't redirecting properly. The form is not send to my inbox as well. But the form is processed now.

                MODX and Formit are up to date. [ed. note: handjes last edited this post 6 years ago.]
                  • 3749
                  • 24,544 Posts
                  Check the allow_forward_across_contexts System Setting.
                    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 still says: Page isn't redirecting properly, aftersubmitting. Form seems to be processed, but mail is not sent.
                      • 3749
                      • 24,544 Posts
                      Try deleting all files in the core/cache directory to make sure the new setting takes effect.
                        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