We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 19980 ☆ A M B ☆
    • 275 Posts
    Hey

    I have the latest formit 2.0.2 call in my not very last release of MODX revo - v. 2.1.3

    [[!FormIt?
    &hooks=`spam,redirect`
    &emailTpl=`EmailChunk`
    &emailTo=`[email protected]`
    &redirectTo=`12`
    &validate=`Name:required`
    ]]

    the <b>![[!+fi.error_message]]!</b> [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]] validation notices are always empty, do you know why?

    The form HTML5 is simple :


    <form action="[[~[[*id]]]]" method="post" name="myform">
    <input type="text" placeholder="Full Name" name="Name" value="[[!+fi.Name]]">
    <input type="text" placeholder="Telephone" name="Telephone" value="[[!+fi.Telephone]]">
    <input type="text" placeholder="Mobile Number" name="Number" value="[[!+fi.Number]]">
    <input type="text" placeholder="Enter Postcode" name="Postcode" value="[[!+fi.Postcode]]">
    <textarea cols="30" rows="10" placeholder="Enter Enquiry Here..." name="Comms" value="[[!+fi.Comms]]"></textarea>
    <a onclick="javascript: document.myform.submit();" class="button yellow right">Get Directions</a>
    </form>

    Please suggest, thanks!

      modx and ecommerce pro
      • 1343 ☆ A M B ☆
      • 2,213 Posts
      You would want:

      [[!+fi.error_message:notempty=`<p>[[!+fi.error_message]]</p>`]]
        Patrick | Server Wrangler
        About Me: Website | Tweets |  MODX Hosting
        • 19980 ☆ A M B ☆
        • 275 Posts
        Thanks.

        Not sure I got even this working, all can make to work is : [[!+fi.validation_error_message:notempty=`[[!+fi.validation_error_message]]`]]
          modx and ecommerce pro
          • 19980 ☆ A M B ☆
          • 275 Posts
          Could anyone suggest how to output error of any not validated field, please?
            modx and ecommerce pro
            • 28120
            • 380 Posts
            Have you looked through the HTML of the example?

            http://rtfm.modx.com/display/ADDON/FormIt.Examples.Simple+Contact+Page
              • 19980 ☆ A M B ☆
              • 275 Posts
              Thanks Mark.
              Sure, but all I could make to work is to output : "A form validation error occurred. Please check the values you have entered. " when any of the field get not validated. I need it to output which field input 's wrong. I believe it is to do with &validationErrorBulkTpl which is used as a default in my case. So all I can make it to alert is [[!+fi.error_message:notempty=`<p>A form validation error occurred. Please check the values you have entered.</p>`]]

              Please suggest, thanks
                modx and ecommerce pro
                • 28120
                • 380 Posts
                Have you tried

                &validationErrorMessage=`[[+errors]]`