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

    Using MODx 2.4.0 and the latest install of formit.
    When filling out the form the verification works on submit however if this is correct the form does not submit and does not forward to the thankyou page.
    This may not have worked for a long time and I have not touched modx for a long time so I wonder if someone can see anything really obvious in the following.

    [[!+fi.validation_error_message]] [[+errors]] [[!FormIt? &hooks=`email,math,redirect` &emailTpl=`LashSentEmailTpl` &emailSubject=`Message from My Website` &emailTo=`[email protected]` &mathMaxRange=`20` &redirectTo=`15` &validate=`contact_name:required:minLength=^2^, contact_email:email:required, telephone:blank, contact_message:required:stripTags` ]]


    And here is the form
    <form action="[[~[[*id]]]]" method="post">[[!+fi.error.contact_name]] <input type="hidden" name="telephone" value="" /> <label for="contact_name">Name </label> <input id="contact_name" class="required" type="text" name="contact_name" value="[[!+fi.contact_name]] " size="30" /> <label for="contact_email">E-Mail </label><em>(required)</em><br /> [[!+fi.error.contact_email]] <input id="contact_email" class="required email" type="text" name="contact_email" value="[[!+fi.contact_email]]" size="30" /> <label for="contact_message">Your comment </label><em>(required)</em><br /> [[!+fi.error.contact_message]] <textarea id="contact_message" class="required" name="contact_message" rows="7" cols="70">[[!+fi.contact_message]]</textarea><br /> <label>[[!+fi.op1]] [[!+fi.operator:is=`-`:then=`minus`:else=`plus`]] [[!+fi.op2]]?</label><br /> [[!+fi.error.math]] <input type="text" name="math:required" value="[[!+fi.math]]" /> <input type="hidden" name="op1" value="[[!+fi.op1]]" /> <input type="hidden" name="op2" value="[[!+fi.op2]]" /> <input type="hidden" name="operator" value="[[!+fi.operator]]" /><br /> <em>Got to check you are human enter maths answer above</em><br /><br /> <input class="submit-button" type="submit" name="submit" value="Submit" /></form>


    That used to work but I now have no idea why not, anyone know what else might be worth checking out.

    Thanks

    Ian
      • 46668
      • 51 Posts
      Update.

      I checked the error log and it has this
      [2015-10-22 12:18:08] (ERROR @ /index.php) [FormIt] An error occurred while trying to send the email. Could not instantiate mail function.

      Is this a server thing

      Thanks
        • 28042 ☆ A M B ☆
        • 24,524 Posts
        Could be a server thing. Sounds like the PHP mail() function has been blocked. Try the QuickEmail extra to test your email. You may need to set up SMTP mail in the system settings.

        http://bobsguides.com/quickemail-snippet-tutorial.html

          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
          • 46668
          • 51 Posts
          Quote from: sottwell at Nov 08, 2015, 09:00 PM
          Could be a server thing. Sounds like the PHP mail() function has been blocked. Try the QuickEmail extra to test your email. You may need to set up SMTP mail in the system settings.

          http://bobsguides.com/quickemail-snippet-tutorial.html

          Yes it was a server issue, the server people sent me one email saying try it now it was working then they sent me another one saying I should be using smtp authentication however the form still works,

          In case I do have to use smtp for my own reference I'll post a handy link for myself
          https://forums.modx.com/index.php/topic,59738.msg339843.html#msg339843

          Thanks very much for the reply

          Cheers