We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hi all,
    This is a bit of a strange one and if anyone can point me in the right direction that would be great. I've re-checked and re-checked my code and call but seem to having a bit of a problem with FormIt and &validate call. This is my call:

    [[!FormIt? &hooks=`spam,email,redirect` &emailTpl=`emailResponse` &emailTo=`[email protected]` &redirectTo=`30` &validate=`name:required,email:email:required`  ]] [[+fi.error.error_message]]


    The form is very simple:
    <form id="EmailForm" action="[[~[[*id]]]]" method="post">
    <input type="hidden" name="nospam:blank" /> 
    <label for="Name">First name:[[!+fi.error.name]]</label> <input id="name" type="text" name="name" value="[[!+fi.name]]" /> 
    
    <label for="Surname">Surname:[[+!fi.error.surname]]</label><input id="surname" type="text" name="surname" value="[[!+fi.surname]]" />
    
    <label for="Company">Company:</label> <input id="company" type="text" name="company" value=""/>
    
    <label for="Country">Country:[[!+fi.error.country]]</label> <input id="country" type="text" name="country" value="[[+!fi.country]]" /> 
    
    <label for="Email">Email Address:[[!+fi.error.email]]</label> <input id="email" type="text" name="email" value="[[!+fi.email]]" />
    
    <div id="text"><label for="Message">Message: [[!+fi.error.message]]</label> <textarea id="message" name="message" rows="7" cols="55">[[!+fi.message]]</textarea></div>
    <br class="clear" /> 
    
    <input id="enquire" type="submit" value="Send Enquiry" />
    </form>


    The form works and sends, however, I want to add validation to other fields as can be seen - I want to include surname, country and message but as soon as I add these to &valdidate the form and page disappear on the front end.

    I've tried adding &submitVar=`1` but that doesn't work either.

    I'm using FormIt 2.0.2 and Rev 2.1.5 - have I made some silly typo because I can't see for looking now smiley Not experienced this problem before when using 2.1.3.

    Or is this a bug....? wink
      Helen Warner
      Number one pixel!
      Proud to be linked with MODX at Crimson Pixel
    • Have created a bug report as it looks like I'm not alone

      http://bugs.modx.com/issues/6219
        Helen Warner
        Number one pixel!
        Proud to be linked with MODX at Crimson Pixel
      • Not really a bug with FormIt as such, spent several hours going through various snippets and plugins uninstalling and re-installing to see if there was a conflict somewhere, and then having used the modx-boilerplate code found that the snippet calls in the head meta tags seemed to be the problem. I removed the snippet calls in the following code (keeping the meta tags) and all seems to be working correctly.

        <meta name="description" content="[[*introtext:empty=`[[*content:strip_tags]]`:limit=`200`]]">
        <meta name="author" content="[[If? &subject=`[[*publishedby]]` &operator=`>` &operand=`0` &then=`[[*publishedby:userinfo=`fullname`]]` &else=`[[*createdby:userinfo=`fullname`]]`]]" />
        <meta name="keywords" content="" />


        Hopefully will help someone from pulling all their hair out wink
          Helen Warner
          Number one pixel!
          Proud to be linked with MODX at Crimson Pixel