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

    I have inherited a site which uses Formit for their contact form.
    I can't see anything wrong withthe code that was produced - I wonder if anyone can spot any issues in the chunk below which is called for the contact form?

    [[!+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,
    contact_message:required:stripTags` ]]
    <div id="contact-area">
    <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>

    [[!+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>

    [[!+fi.error.contact_message]]
    <textarea id="contact_message" class="required" name="contact_message" rows="7" cols="70">[[!+fi.contact_message]]</textarea>


    <label>[[!+fi.op1]] [[!+fi.operator:is=`-`:then=`minus`:else=`plus`]] [[!+fi.op2]]?</label>
    [[!+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]]" />

    <em>Got to check you are human enter maths answer above</em>


    <input class="submit-button" type="submit" name="submit" value="Submit" />
    </form>
    </div>


    In the back end there are no submissions within Extras > Formit
    There aren't even any forms listed there - i assumed that's where all the data would be stored?

    I have never used Formit so I'm not sure what I'm looking for.

    Any help would be much appreciated!
    Thanks
    Andy
      • 51020
      • 670 Posts
      Furthermore, it's not redirecting to resource 15 after submission - so it sounds like it's not submitting the form at all?
        • 28432
        • 372 Posts
        Hello Andy,

        The form are not listed like in WordPress, and no data are stored unless you use Formit2db with a custom data base.
        Have you check the errors log ?
          • 51020
          • 670 Posts
          Quote from: Steeve at Oct 12, 2016, 05:10 AM
          Hello Andy,

          The form are not listed like in WordPress, and no data are stored unless you use Formit2db with a custom data base.
          Have you check the errors log ?

          Hello there. OK - I'm not too worried about the forms not being stored if that's the default behaviour. I currently don't have access to error logs, but I'll see if I can get access to these.

          Strange that it's not redirecting to the success page though - it's as if it's not submitting at all?
            • 22840
            • 1,572 Posts
            Strange that it's not redirecting to the success page though - it's as if it's not submitting at all?

            Try taking the validation and math out and see if it redirects then, if so start adding them back in 1 at a time
              • 51020
              • 670 Posts
              Quote from: paulp at Oct 12, 2016, 05:39 AM
              Strange that it's not redirecting to the success page though - it's as if it's not submitting at all?

              Try taking the validation and math out and see if it redirects then, if so start adding them back in 1 at a time

              Thanks - I have just tied this - below is my new Formit call - but it's still not submitting the form, or redirecting me:

              [[!FormIt?
              &hooks=`email,redirect`
              &emailTpl=`LashSentEmailTpl`
              &emailSubject=`Message from My Website`
              &emailTo=`[email protected]`
              &redirectTo=`15`
              ]]
              <div id="contact-area">
                  <form action="[[~[[*id]]]]" method="post">
                  <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 />
                  <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 />
                  <textarea id="contact_message" class="required" name="contact_message" rows="7" cols="70">[[!+fi.contact_message]]</textarea>
                  <br />
                  <input class="submit-button" type="submit" name="submit" value="Submit" />
                  </form>
                  </div>
                  
                  


              Any ideas?
                • 51020
                • 670 Posts
                Hi All - I have found an error message which says:
                An error occurred while trying to send the email. SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

                I've looked in the wiki, but cannot really understand what's it's advising.
                Can anyone let me know if this error applies to Modx or to the Server itself?

                Thanks
                Andy
                  • 22840
                  • 1,572 Posts
                  Try Bob's quick email addon as it helps solve email issues

                  http://bobsguides.com/quickemail-snippet-tutorial.html
                    • 51020
                    • 670 Posts
                    Quote from: paulp at Oct 12, 2016, 10:28 AM
                    Try Bob's quick email addon as it helps solve email issues

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

                    Thanks for the tip - I found this was already installed - so the previous developer obviously had a similar issue before he jumped ship! lol.

                    so this is what the debug spat out after it failed to send:
                    Send Failed
                    Mailer error info: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
                    Server Debug Information:
                    
                    2016-10-12 15:32:35	SMTP ERROR: Failed to connect to server: Connection timed out (110)
                    2016-10-12 15:32:35	SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
                    


                    So does this mean there are issues with the hosting, as opposed to the modx installation?
                      • 28432
                      • 372 Posts
                      Quote from: tm2000 at Oct 12, 2016, 05:23 AM
                      I currently don't have access to error logs, but I'll see if I can get access to these.
                      You can access to the errors logs inside the modx manager : Administration > Reports > Errors log.

                      1. Make sure the ressource with ID 15 exist and is published
                      2. Make sure LashSentEmailTpl chunk exist.

                      I hope this help.

                      EDIT : Sorry i didn't see last post.
                      It seems you got something wrong with SMTP on your server or configuration inside modx manager.