We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
  • Hello,

    Been using FormIt for awhile and have always had success (usually adapting purchased templates and the form styles they have within them). But this time, absolutely no luck. The form appears to submit but I get no success messages, no error messages, and no email messages. I do get all of that on the same server with another site (this one is a subdomain of the other).

    Here is the code:

    [[!FormIt?
    &hooks=`spam,email,FormItAutoResponder`
    &emailTpl=`request`
    &emailTo=`[email protected]`
    &emailSubject=`Protect All Points Enquiry`
    &emailMultiSeparator=`<br />`
    &fiarTpl=`response`
    &fiarSubject=`Thank You for Enquiring about Protect All Points`
    &fiarToField=`email`
    &fiarFrom=`[email protected]`
    &fiarReplyTo=`[email protected]`
    &fiarFromName=`Protect All Points`
    &successMessage=`<p><strong>Thank you</strong> for your enquiry. We will be in touch shortly.</p>`
    &validationErrorMessage=`<p><strong>Error</strong>, Please fill out all required fields.</p>` 
    &submitVar=`go`
    &validate=`name:required,email:email:required,company:required,workemail:blank`
    ]]
    <form id="contact-form" action="[[~[[*id]]]]" method="post">
        <fieldset>
            <div class="float-left">
                <label for="name">Full Name</label>
                <input id="Name" type="text" name="name" value="[[!+fi.name]]" />
                <label for="email">Email Address</label>
                <input id="Email" type="text" name="email" value="[[!+fi.email]]" />
                <input type="hidden" name="workemail" value="" />
                <label for="phone">Phone Number</label>
                <input id="Phone" type="text" name="phone" value="[[!+fi.phone]]" />
            </div>
            <div class="float-right">
                <label for="company">Company</label>
                <input id="Company" type="text" name="company" value="[[!+fi.company]]" />
                <label for="message">Message</label>
                <textarea id="Message" rows="10" cols="10" name="message" value="[[!+fi.message]]"></textarea>
              [[!+fi.error_message]]
    	  [[+fi.successMessage]]
    	  <button type="submit" name="go">Send Enquiry</button>
            </div>
            <div class="clear"></div>
        </fieldset>	
    </form>
    
      • 28215
      • 4,149 Posts
      You have the "spam" hook here, but I don't see the spam field...
        shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • Thanks.

        Right, so I added this to the form:

        <input type="hidden" name="nospam:blank" value="" />


        Is that correct?

        In the docs for the spam hook it says:

        Simply specify the "spam" hook in your FormIt call. FormIt will handle the rest.

        [[!FormIt? &hooks=`spam`]]

        So I'm a little confused as to what exactly the spam field is and if I'm using the correct line (from the example in the docs).

        Still get the same result, which is no response (http://link.collaborativemedia.ca/index.php?id=1)

        Tested similar code here: http://www.collaborativemedia.ca/index.php?id=19 and all went through fine.

        [[!FormIt?
        &hooks=`fiProcessArrays,spam,email,FormItAutoResponder,redirect`
        &emailTpl=`request`
        &emailTo=`[[*emailrecipients]]`
        &emailSubject=`[[*emailsubject]]`
        &emailMultiSeparator=`<br />`
        &fiarTpl=`response`
        &fiarSubject=`[[*emailsubjectout]]`
        &fiarToField=`email`
        &fiarFrom=`[[*emailfrom]]`
        &fiarReplyTo=`[[*emailreplyto]]`
        &fiarFromName=`[[*emailreplyname]]`
        &redirectTo=`20`
        &store=`1`
        &submitVar=`go`
        &validate=`name:required,email:email:required,workemail:blank`
        ]]
        
            <form class="iphorm" action="[[~[[*id]]]]" method="post">
            <input type="hidden" name="nospam:blank" value="" />
        	<div class="iphorm-wrapper">
        	    <div class="iphorm-inner">
        		    <div class="iphorm-message fierror">[[!+fi.error.name]]</div>
        			    <div class="iphorm-container clearfix">
        			      <!-- Begin Name element -->
        			      <div class="element-wrapper name-element-wrapper clearfix">
        			      <label for="name">Name <span class="required">(required)</span></label>
        				  <div class="input-wrapper name-input-wrapper">
        				  <input class="name-element" id="name" type="text" name="name" value="[[!+fi.name]]" />
        				  </div>
        			      </div>
        			      <!-- End Name element -->
        			      <!-- Begin Email element -->
        			      <div class="element-wrapper email-element-wrapper clearfix">
        			      <label for="email">Email <span class="required">(required)</span></label>
        				  <div class="input-wrapper email-input-wrapper">
        				  <input class="email-element" id="email" type="text" name="email" value="[[!+fi.email]]" />
        				  <input type="hidden" name="workemail" value="" />
        				  </div>
        			      </div>
        			      <!-- End Email element -->
        			      <!-- Begin Phone element -->
        			      <div class="element-wrapper phone-element-wrapper clearfix">
        			      <label for="phone">Phone</label>
        				  <div class="input-wrapper phone-input-wrapper">
        				  <input class="phone-element" id="phone" type="text" name="phone" value="[[!+fi.phone]]" />
        				  </div>
        			      </div>
        			      <!-- End Phone element -->
        			      <!-- Begin Message element -->
        			      <div class="element-wrapper message-element-wrapper clearfix">
        			      <label for="message">Message</label>
        				  <div class="input-wrapper message-input-wrapper clearfix">
        				  <textarea class="message-element" id="message" name="message" rows="7" cols="45" value="[[!+fi.message]]">[[!+fi.message]]</textarea>
        				  </div>
        			      </div>
        			      <!-- End Message element -->
        			      <!-- Begin Captcha element
        			      <div class="element-wrapper captcha-element-wrapper clearfix">
        			      <label for="type_the_word">Type the word <span class="required">(required)</span></label>
        				  <div class="input-wrapper captcha-input-wrapper clearfix">
        				      <div class="captcha-img"><img src="contact-form/images/captcha.png" alt="" /></div>
        				      <input id="type_the_word" class="captcha-element" type="text" name="type_the_word" />
        				  </div>
        			      </div>
        			      <!-- End Captcha element -->
        			      <!-- Begin Submit button -->
        			      <div class="button-wrapper submit-button-wrapper clearfix">
        				  <div class="button-input-wrapper submit-button-input-wrapper">
        				  <input class="ka-form-submit" type="submit" name="go" value="Submit" />
        				  </div>
        			      </div>
        			      <!-- End Submit button -->
        		</div>
        	    </div>
        	</div>
            </form>
        


        I have a feeling I'm having a simple thing I'm missing but shouldn't moment.
          • 3749
          • 24,544 Posts
          The spam hook just checks the user's email address against lists of known spammers using a web service called StopForumSpan. All you need to do to use it is include it in the list in the &hooks property. It won't work unless you have cURL enabled, however.
            Did I help you? Buy me a beer
            Get my Book: MODX:The Official Guide
            MODX info for everyone: http://bobsguides.com/modx.html
            My MODX Extras
            Bob's Guides is now hosted at A2 MODX Hosting
            • 3749
            • 24,544 Posts
            Quote from: splittingred at Jan 03, 2012, 03:12 PM
            You have the "spam" hook here, but I don't see the spam field...

            Doesn't the field default to email?
              Did I help you? Buy me a beer
              Get my Book: MODX:The Official Guide
              MODX info for everyone: http://bobsguides.com/modx.html
              My MODX Extras
              Bob's Guides is now hosted at A2 MODX Hosting