We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25519
    • 265 Posts
    Hi,

    I'm loading a really simple FormIt example and it's whirring, but just not sending - all fields remain populated and there's no send or redirect.

    I've seen similar examples here but no real resolution, apart from these: http://forums.modx.com/thread/74403/formit-does-nothing#dis-post-412643 However I'm not sure what he meant ...
    and this:
    http://forums.modx.com/thread/76963/solved-formit-doesn-t-send-email-on-dreamhost-hosting#dis-post-425367 but it didn't work for me.

    I'm running in 2.2.2 on a fine Linux setup - I've tried QuickEmail and all's fine there so i guess my snippet call is wonky. Here it is if anyone would be so kind to cast an eye:
    [[!FormIt?
       &hooks=`recaptcha,email,redirect`
    	 &emailTpl=`emailTemplate`
       &emailSubject=`WASSSAAAAAPPPP`   
       &emailFrom=`[email protected]`
       &emailTo=`[email protected]`
       &redirectTo=`19`
       &validate=`name:required,
          email:email:required,
          subject:required,
          text:required:stripTags`
    ]]
    
    [[!+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>
     
        <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>
    
    • Try removing the &validation portion of the Snippet to see if that fixes the form. If it does, then you know that's where your problem is. A common error occurs when the validation rules reference the incorrect field names.

      Secondly, try removing the CAPTCHA and see if that makes it work. Is this placeholder correct?

       [[!+formit.recaptcha_html]]


      Should it be this?

       [[!+fi.recaptcha_html]]
        • 25519
        • 265 Posts
        Hi and many thanks for the reply.

        The recaptcha was the rogue, removed that and it was mostly fine, but i've also found out that adding the code straight into tinymce breaks it too, so i just call the whole snippet from a chunk in the RTE.

        Incidentally, formit.recaptcha_html was copied straight from the example so i'm going to do more tinkering.

        Cheers
          • 3749
          • 24,544 Posts
          You should always turn TinyMCE off (by unchecking the richtext checkbox on the Page Settings tab or the Create/Edit Resource panel and saving and reloading the page) before pasting code.


          For recaptcha to work, you need to set the recaptcha key properties in the snippet tag.



          ------------------------------------------------------------------------------------------
          PLEASE, PLEASE specify the version of MODX you are using.
          MODX info for everyone: http://bobsguides.com/modx.html
            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