We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 28215
    • 4,149 Posts
    This is an auto-generated topic for FormIt 1.5.0-pl by splittingred.

    Brief Description:

    Automatically validate, parse and email forms. Redirect to thank you pages. Add your own hooks as Snippets to handle forms dynamically. Validate with custom Snippets. All is possible in FormIt, the new form processing Snippet for MODx Revolution 2.0.
    New in 1.5.0

    • Fixed bug with redirectParams not parsing placeholders in the params
    • Added redirectParams property, which allows a JSON object of params to be passed when using redirect hook
    • Added spamCheckIp property, defaults to false, to check IP as well in spam hook
    • Fixed incorrect default param for fiarSender
    • Fixed error reporting for FormItAutoResponder
    • Added sanity checks to form attachments when dealing with missing names
    • Fixed invalid offset error in checkbox validation
    • Added recaptchaJS to allow for custom JS overriding of reCaptcha options var

    New in 1.4.1

    • Added sanity check for emailHtml property on email hook
    • Added sanity check for replyto/cc/bcc emails on email hook
    • Added ability to change language via &language parameter

    See the Official Documentation here:
    http://rtfm.modx.com/display/ADDON/FormIt
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • 12941
      • 87 Posts
      So, I set this up using the basic contact form example as a guide... everything seems to be working as expected, except for my email chunk. I receive the email after submitting, but the placeholders didn’t work. There’s no content inserted just [[+placeholder]] code.

      For example, this is what my email chunk code is, and this is exactly what shows up in my email... instead of placing the placeholders with the actual form data.

      [[+name]] ([[+email]]) Wrote: 
      Phone: [[+phone]]
      Fax: [[+fax]]
      Company: [[+company]]
      Address: [[+street]]
      [[+City]], [[+state]] [[+zip]]
      Subject: [[+subject]] 
      Services Requested: [[+services]] 
      Date(s) of Event: [[+event-date]] 
      
      [[+message]] 


      Here’s my snippet call:
            [[!FormIt?  
              &hooks=`recaptcha,spam,email,redirect`  
              &emailTpl=`contact-email-notification`  
              &emailTo=`my email`
              &emailSubject=`Contact Form Submission`
              &redirectTo=`20`  
              &validate=`name:required,  
                 email:email:required,  
                 subject:required,  
                 message:required:stripTags,
                 event-date:required`        
            ]]



      And here’s my form:
            <form action="[[~[[*id]]]]" method="post">
                  <input type="hidden" name="nospam:blank" value="" />
                      <p>* Required Fields</p>
      		<table width="100%">
      		  <tr>
      		    <td class="formtitle"><label for="Your Name">Your Name*:<span class="error">[[+fi.error.name]]</span></label></td>
      		    <td><input name="[[+fi.name]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Email">Email*:<span class="error">[[+fi.error.email]]</span></label></td>
      		    <td><input name="[[+fi.email]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Phone">Phone:<span class="error">[[+fi.error.phone]]</span></label></td>
      		    <td><input name="[[+fi.phone]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Fax">Fax:<span class="error">[[+fi.error.fax]]</span></label></td>
      		    <td><input name="[[+fi.fax]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Company">Company:<span class="error">[[+fi.error.company]]</span></label></td>
      		    <td><input name="[[+fi.company]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Street">Street:<span class="error">[[+fi.error.street]]</span></label></td>
      		    <td><input name="[[+fi.street]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="City">City:<span class="error">[[+fi.error.city]]</span></label></td>
      		    <td><input name="[[+fi.city]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="State">State:<span class="error">[[+fi.error.state]]</span></label></td>
      		    <td><input name="State" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Zip">Zip:<span class="error">[[+fi.error.zip]]</span></label></td>
      		    <td><input name="[[+fi.zip]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Subject">Subject:*<span class="error">[[+fi.error.subject]]</span></label></td>
      		    <td><input name="[[+fi.subject]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Services Requested">Services Requested:<span class="error">[[+fi.error.services]]</span></label></td>
      		    <td><input name="[[+fi.services]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Date(s) of Event">Date(s) of Event*:<span class="error">[[+fi.error.event-date]]</span></label></td>
      		    <td><input name="[[+fi.event-date]]" type="text" class="input" size="40"></td>
      		  </tr>
      		  <tr>
      		    <td class="formtitle"><label for="Message">Message*:<span class="error">[[+fi.error.message]]</span></label></td>
      		    <td><textarea name="[[+fi.message]]" cols="31" rows="4" class="input"></textarea></td>
      		  </tr>
                        <tr>
                          <td colspan="2">
                            [[!+formit.recaptcha_html]]
                            [[!+fi.error.recaptcha]]
                          </td>
                        </tr>
      		  <tr>
      		    <td> </td>
      		    <td><input class="submitbutton" type="submit" name="submit" value="Submit"></td>
      		  </tr>
      		</table>
              </form>


      Any ideas? Did I make an obvious beginners mistake somewhere?
        • 1778
        • 659 Posts
        Hello

        There is a little problem with your form you put the [[+something]] in the wrong attribute as below

        <input name="[[+fi.name]]" type="text" class="input" size="40">
        shoud be


        <input name="name" type="text" class="input" size="40" value="[[+fi.name]]">

        If you want a validator you have to append it in the name attribute of your field like this, (you can add as many validators you want/need)

        <input name="name:required" type="text" class="input" size="40" value="[[+fi.name]]">

        The attribute ’name="name of field" ’ allows you to identify your field or your group of fields if the fields are checkboxes or radio buttons, the attribue ’value="[[+fi.name of field]]" ’ retains the value filled in, and pass it to your email message...

        Hope this helps
        cheers
          • 28215
          • 4,149 Posts
          Note, it’s recommended to *not* use in-field validators anymore, since those can be bypassed via straight POSTs.

          Use the &validate property on the FormIt snippet call.
            shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
            • 12941
            • 87 Posts
            Oh my, I feel like quite a ninny now. Thanks for setting me straight. I’ll let you know if I have any more issues!
              • 12941
              • 87 Posts
              OK, so I got the form working properly, it sends, all of my data is there... however, the Thank You page is saying: "Error: Unauthorized Access". I double checked and the Thank You page is published. Before I made these changes it was displaying a different message with a link to go back.
                • 19597
                • 44 Posts
                I’m also having trouble with this FormIt... but my trouble seems to be a LOT broader than the others. I don’t even know where to BEGIN and how to SET THIS UP PROPERLY sad I can’t seem to find any instructions or documentation anywhere telling me where to start, how to add it, etc.. All I can see is the FormIt snippits which have a bunch of code in it that I can’t make heads or tails of.


                Where do I go to get some insight on setting this up right?! Thanks!
                  • 28042 ☆ A M B ☆
                  • 24,524 Posts
                    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