We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 36926
    • 701 Posts
    Hi,
    Got a strange issue with formit.

    For some reason formit seems to display the main error message once the email field is populated even with a valid email address.

    It doesn't display the actual validation reason, ie 'this field is require' or 'this isn't a valid email address' It just displays the 'A form validation error occurred. Please check the values you have entered.' message.

    Strange thing is if i leave it empty it doesn't display the error.

    I've even tried removing the validation parameter in the formit call and making the form and call as basic as possible.

    This is the basic call i have
    [[!FormIt? &hooks=`email` &emailTpl=`email.Tpl` &emailTo=`[email protected]`]]
    


    And the basic form is:
    <form action="[[~[[*id]]]]" method="post" class="form" id="propForm">
    [[!+fi.validation_error_message]]
      <label for="email">
            Email:<span class="error">[[!+fi.error.email]]</span>
       </label>
        <input type="text" name="email" id="email" value="[[!+fi.email]]" />
    <button name="submit" value="Submit" type="submit">Submit</button>
    </form>
    


    Now if i change the name attribute value for the input then it seems to work ok.

    I'm running modx 2.2.6 and formit 2.1.2

    Anyone any ideas?
    • No idea. I copy/pasted the exact snippet call and form, and it works perfectly.
        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
        • 36926
        • 701 Posts
        Quote from: sottwell at Dec 11, 2012, 11:46 PM
        No idea. I copy/pasted the exact snippet call and form, and it works perfectly.

        Thanks Susan, your helped confirm it wasn't a bug and something on my template. So due to that started stripping out chunks of the template and found the extra expandable contact form in the footer which i'd completely forgotten about, doh smiley

        So that was the issue as that also contained the email field and the error was getting displayed within the hidden footer.

        This has been driving me crazy as spent the last 4hr thinking my JS validation was doing something.

        Thanks again

        Ben
        • I've found a good troubleshooting approach is to try whatever is causing the problem on an otherwise empty resource with an empty or minimal template. I do this if it takes me more than 5-10 minutes to figure out what I've done wrong.
            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
          • Good advice Susan! I rarely do this, but will in the future because it makes so much freakin sense.

            This very wise advice should be on every page at the rtfm. I wonder how many hours this would save the world if everyone knew...

            :~}
              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
            • One of the three virtues of great programmers (according to Larry Wall) is laziness. Over the years I've gradually distilled out the easiest way to do things wink
                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
              • Now you tell us?

                JK, we love you Susan. Thank you for sharing anything you've got to share.

                :~}
                  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