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

    I've got a new site, Formit was working properly till this weekend. Then it just... stopped. after submitting, the page refreshes and nothing else happens.
    Interestingly, if I try to refresh the page after that, I get the chrome error message

    Confirm page resubmission.

    The page that you're looking for used information that you entered...

    Here's my code:
    [[!FormIt?
       &hooks=`spam,email,redirect`
       &emailTpl=`mailChunk`
       &emailTo=`[email protected]`
       &emailFrom=`[email protected]`
       &emailSubject=`WEBSITE ENQUIRY`
       &redirectTo=`60`
       &validate=`name:required,
           email:email:required,
           text:required:stripTags`
    ]] 
    
    [[!+fi.validation_error_message:notempty=`<p>[[!+fi.validation_error_message]]</p>`]]
    <form action="[[~[[*id]]]]" method="POST" class="form" id="contact-form">
        <div class="form-group">
            <input type="hidden" name="nospam:blank" value="[[+fi.nospam]]" />
           
            <input class="form-control mt24" placeholder="NAME" id="name" name="name" type="text" value="[[!+fi.name]]"/>
            <span class="error">[[!+fi.error.name]]</span>
           
            <input class="form-control mt16" placeholder="EMAIL" id="email" name="email" type="text" value="[[!+fi.email]]"/>
            <span class="error">[[!+fi.error.email]]</span>
            <input class="form-control mt16" placeholder="CONTACT NUMBER" id="phone" name="phone" type="text" value="[[!+fi.phone]]"/>
           
            <textarea class="form-control mt16" id="text" name="text" placeholder="MESSAGE" value="[[!+fi.text]]">[[!+fi.text]]</textarea>
            <span class="error">[[!+fi.error.text]]</span>
            <input class="btn btn-default mt16 pull-left" name="form-submit" type="submit" value="SUBMIT">
        </div>
    </form>
    


    You can test for yourselves here... http://curiousandcreative.co.za/

    I've also tried the quickEmail snippet and that works fine... any ideas? [ed. note: justimaging last edited this post 10 years, 8 months ago.]
      • 36435
      • 40 Posts
      I've tried both with and without SMTP, there's nothing in the error logs and I've gone through the forums, but I can't find anything that works.
      It's like the form isn't POSTing

      Anyone have any ideas?
        • 30585
        • 833 Posts
        Are your getting any errors in the logs? The next step will be to remove the spam hook and see if it works without it.
          A MODx Fanatic
          • 36435
          • 40 Posts
          Hi Treigh - I'd tried that. Had stripped it down to the bare minimum - even without the redirect, &emailSubject and validate.

          There was nothing in the error logs before, but something's just shown up now:

          [2016-01-26 15:00:07] (ERROR @ /manager/index.php) [configcheck] check core lockdown curl err: 6


          I think that's because I changed .htaccess in the /core folder back to ht.access.

          This was the only thing I'd changed since last week (making it .htaccess). I'd tried changing it back to ht.access, but still no joy
            • 30585
            • 833 Posts
            This shouldn't affect you negatively. You can change your timezone if needed -- this should take care of their time difference.
              A MODx Fanatic
              • 36435
              • 40 Posts
              Hi Guys.

              I've re-written the code a couple of time, to make sure I didn't leave anything out or I hadn't made any typos. There's no change

              Anyone have any ideas? Also, it's like the form isn't being processed at all - after submitting, I'm still getting the messages that information will be resubmitted.

              Firefox:
              To display this page, Firefox must send information that will repeat any action (such as a search or order confirmation) that was performed earlier.


              Chrome:
              Confirm Form Resubmission
              The page that you are looking for used information that you entered. Returning to that page might cause any action you took to be repeated. Do you want to continue?
              (continue) (cancel)

              If I hit continue, I'll keep getting it on every refresh...

              Any ideas...?
                • 36435
                • 40 Posts
                Alternatively, how can I go about setting up the form without Formit?
                I've used formit several times on other sites, but it's time to throw in the towel, I think...
                  • 47401
                  • 295 Posts
                  ok, i think ive found your problem. Formit is looking for the following within the formit code:

                  &submitVar=`changeme`


                  Change 'changeme' to the input name of the submit button, in this case its 'form-submit'

                  also a couple of changes needed:

                  replace the nospam input box with the following:
                  <input type="hidden" name="nospam" value="[[+fi.nospam]]" />


                  textarea does not need a value, so remove the value= from the textarea.

                  in the &validate= add in:

                  nospam:blank


                  have ago at making these changes and let me know how you get on wink
                    • 36435
                    • 40 Posts
                    Hi CompNerd. Thanks for the response.

                    Still no luck, though. I'm starting to suspect it may be something outside of Formit. However Quickemail still seems to work:

                    System Settings (used if property is missing):

                    emailsender System Setting: ***@gmail.com
                    site_name System Setting: Curious&Creative
                    Properties (from parameters, property set, or snippet default properties:

                    Tpl chunk name:
                    subject:
                    to:
                    fromName:
                    replyTo:
                    emailSender:
                    allowHtml: 1
                    message:
                    Final Values (actually used when sending email):

                    subject: Default Subject
                    to: ***@gmail.com
                    fromName: QuickEmail
                    replyTo: ***@gmail.com
                    emailSender: ***@gmail.com
                    allowHtml: 1
                    Message Body: Default Message
                    Send reported successful

                    I've tried both with and without SMTP.

                    Can there be anything that's stopping formit from processing? Is there a way to test for this?
                      • 27708 MODX Staff
                      • 2,502 Posts
                      remove the spam and redirect hook and see if it works without. Be sure if you're using SMTP that you have SMTP prefix set for 'tls' when using Google as it will not allow sends otherwise. Ruling out a breakdown in one hook at a time is the fastest way to solve. Also double check your chunk exists, I think it will silently fail if it's not there.
                        Author of zero books. Formerly of many strange things. Pairs well with meats. Conversations are magical experiences. He's dangerous around code but a markup magician. Blog ✦ Twitter ✦ LinkedIn ✦ GitHub