We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12508
    • 63 Posts
    I used to use Formit to make easy inquiry forms. But today I'm trying to implement it on MODx 2.2.6-pl and is not working at all. Not sending mails, not redirecting, nothing. Can anybody please help me to solve this problem? Here my template (actually it is the same example from http://rtfm.modx.com/display/ADDON/FormIt.Examples.Simple+Contact+Page#FormIt.Examples.SimpleContactPage-SnippetTag but modified email, chunk template and redirect id):

    (I tried to remove, recaptcha, spam and leave only email or redirect, nothing works).

    Any help will be appreciated.

    [[!FormIt?
       &hooks=`recaptcha,spam,email,redirect`
       &emailTpl=`chk-inquiry-form`
       &emailTo=`[email protected]`
       &redirectTo=`13`
       &validate=`name:required,
          email:email:required,
          subject:required,
          text:required:stripTags,
          numbers:required,
          colors:required`
    ]]
    
    <h2>Contact Form</h2>
     
    [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
     
    <form action="[[~[[*id]]]]" method="post" class="form">
        <input type="hidden" name="nospam:blank" value="" />
     
        <label for="name">
            Name:
            <span class="error">[[!+fi.error.name]]</span>
        </label>
        <input type="text" name="name" id="name" value="[[!+fi.name]]" />
     
        <label for="email">
            Email:
            <span class="error">[[!+fi.error.email]]</span>
        </label>
        <input type="text" name="email" id="email" value="[[!+fi.email]]" />
     
        <label for="subject">
            Subject:
            <span class="error">[[!+fi.error.subject]]</span>
        </label>
        <input type="text" name="subject" id="subject" value="[[!+fi.subject]]" />
     
        <label for="text">
            Message:
            <span class="error">[[!+fi.error.text]]</span>
        </label>
        <textarea name="text" id="text" cols="55" rows="7" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
     
     
        <label>
            Numbers:[[+fi.error.numbers]]
            <select name="numbers" value="[[!+fi.numbers]]">
                <option value="">Select an option...</option>
                <option value="one" [[!+fi.numbers:FormItIsSelected=`one`]]>One</option>
                <option value="two" [[!+fi.numbers:FormItIsSelected=`two`]]>Two</option>
                <option value="three" [[!+fi.numbers:FormItIsSelected=`three`]]>Three</option>
            </select>
        </label>
     
        <label>
            Colors:[[!+fi.error.colors]]
            <input type="hidden" name="colors[]" value="" />
        </label>
        <ul>
          <li>
            <label><input type="checkbox" name="colors[]" value="red" [[!+fi.colors:FormItIsChecked=`red`]] /> Red</label>
          </li>
          <li>
            <label><input type="checkbox" name="colors[]" value="blue" [[!+fi.colors:FormItIsChecked=`blue`]] /> Blue</label>
          </li>
          <li>
            <label><input type="checkbox" name="colors[]" value="green" [[!+fi.colors:FormItIsChecked=`green`]] /> Green</label>
          </li>
        </ul>
     
        <br class="clear" />
        [[!+formit.recaptcha_html]]
        [[!+fi.error.recaptcha]]
     
        <br class="clear" />
     
        <div class="form-buttons">
            <input type="submit" value="Send Contact Inquiry" />
        </div>
    </form>
    

    This question has been answered by multiple community members. See the first response.

      • 10208 ☆ A M B ☆
      • 1,780 Posts
      What happens if you remove all the validators?
        Frogabog- MODX Websites in Portland Oregon
        "Do yourself a favor and get a copy of "MODX - The Official Guide" by Bob Ray. Read it.
        Having server issues? These guys have MODX Hosting perfected - SkyToaster
        • 3109 ☆ A M B ☆
        • 894 Posts
        Any errors in the Logs? I don't want to sound like a prick but is FormIt installed? (I ask because it has happened to me -_-)
          Benjamin Marte
          Interactive Media Developer
          Follow Me on Twitter | Visit my site | Learn MODX
          • 28042 ☆ A M B ☆
          • 24,524 Posts
          Yeah, I just discovered yesterday on my own site that FormIt works a lot better if it's installed!
            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
            • 3109 ☆ A M B ☆
            • 894 Posts
            Ha Glad to know I'm not the only one, I've also had this happen with Wayfinder as well LOL

            Quote from: sottwell at Jan 28, 2013, 11:20 AM
            Yeah, I just discovered yesterday on my own site that FormIt works a lot better if it's installed!
              Benjamin Marte
              Interactive Media Developer
              Follow Me on Twitter | Visit my site | Learn MODX
              • 12508
              • 63 Posts
              Quote from: frogabog at Jan 28, 2013, 10:37 AM
              What happens if you remove all the validators?

              Nothing. I removed all validators with the same results.
                • 12508
                • 63 Posts
                Quote from: benmarte at Jan 28, 2013, 10:48 AM
                Any errors in the Logs? I don't want to sound like a prick but is FormIt installed? (I ask because it has happened to me -_-)

                @benmarte yes, it is Formit plugin installed.
                  • 9207 ☆ A M B ☆
                  • 2,475 Posts
                  That sounds like a real pain. I've lost my mind over stuff like this, and at some point, it can be really good to walk through everything step by step (and yes, it's extremely frustrating to have to do this). Here's what I've done:

                  1. Clear the MODx logs and the cache (or nuke the entire contents of core/cache/)
                  2. Open up the FormIt Snippet (or whatever the troublemaker is).
                  3. Add in some logging calls like the following:

                  $modx->log(xPDO::LOG_LEVEL_ERROR,'Here I am... inside FormIt' . __LINE__);
                  // Or:
                  $modx->log(xPDO::LOG_LEVEL_ERROR, print_r($_POST, true) ); // log ALL posted data
                  


                  4. Save the modified Snippet
                  5. Re-submit your form
                  6. Check the logs

                  This is a painstaking process sometimes, but it will tell you exactly where the code is breaking (e.g. if you see logging messages 1, 2, but message 3 is AWOL, then you know something broke after the 2nd message). This will also tell you whether the code is executing at all. Another good thing to eyeball is the PHP log on the server AND any firewall logs (e.g. ModSecurity is an awesome application level firewall, but it can kill form posts silently and drive you insane in the process).
                    • 28042 ☆ A M B ☆
                    • 24,524 Posts
                    Check the Manager's error report; I've had it silently fail and just reload the form on SMTP errors.
                      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
                      • 3109 ☆ A M B ☆
                      • 894 Posts
                      Install QuickEmail and diagnose to see if your site is sending emails so we can rule that out.
                        Benjamin Marte
                        Interactive Media Developer
                        Follow Me on Twitter | Visit my site | Learn MODX