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
    Quote from: einsteinsboi at Mar 10, 2011, 03:50 PM

    Is this a required parameter? I have been using FormIt without it and it works just fine for me. Curious to know the answer to this.

    No, but if you have multiple forms on a page, this tells FormIt which form to parse. Otherwise it just checks for $_POST as a whole.
      shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
      • 23299
      • 1,161 Posts
      After Shaun posted that one error I clicked with what needed to be done elsewhere. The form is working fine now. Little strange to wrap your head around at first.

      I like how many CSS classes the form uses: custom styling is easy to do as a result.

      What I really dislike has nothing to do with FormIt or MODx, but rather with the recaptcha system itself. While testing my form (countless times) I found that I needed to reload the recaptcha two or three times before I could read it clearly. Its usually so visually garbled and hard to read...
        • 28215
        • 4,149 Posts
        You might want to look into the ’math’ hook then, instead. It’s pretty good at preventing spammers.

        Also, check out Rampart, which does good spam-prevention as well: http://rtfm.modx.com/display/addon/Rampart
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 23299
          • 1,161 Posts
          Thanks, I will look into those. Reading the Math hook now...

          Is there any reason that the recaptcha graphics are rendered the way they are? I can’t tell you how many times my wife has called me over to help decipher form captcha "text"...
            • 8609
            • 607 Posts
            i think you can change the reCaptcha theme, some seem to be clearer to read than others.
              • 19298
              • 76 Posts
              MichaelHarringtonDesigns Reply #16, 13 years, 1 month ago
              My contact form works fine now and validates laugh

              I would like to do one last thing and that is change the submit button to my own image I have created.
              This is the code I am using:

              <div id="submit">
              <input name="submit" class="submit" type="submit" value="Submit"/>
              </div>

              odeclas mention you can change the colour by using this code
              input [type="submit"] { background-color: blue;}

              What would be the code you would use to change the image of the submit button?
                • 8609
                • 607 Posts
                you can change that in the css

                Quote from: MichaelHarringtonDesigns at Mar 11, 2011, 01:39 PM

                My contact form works fine now and validates laugh

                I would like to do one last thing and that is change the submit button to my own image I have created.
                This is the code I am using:

                <div id="submit">
                <input name="submit" class="submit" type="submit" value="Submit"/>
                </div>

                odeclas mention you can change the colour by using this code
                input [type="submit"] { background-color: blue;}

                What would be the code you would use to change the image of the submit button?

                  • 21451
                  • 4 Posts
                  Hi Everyone,

                  I too have been experiencing problems with my contact form validation. The form does validate, that is field entries that are out-with the defined parameters cause the email not to be sent. However, I am really struggling with trying to get the error messages to show up.

                  I have gone over and over all that has been posted here, and in the comments on lesson 9 at the (excellent) coding pad which concerns FormIt.

                  I would greatly appreciate your help with this as I’m feeling pretty stuck.

                  I have placed the code for the form in a chunk which is called in my template. Please see www.caitlinmorrisimages.com (and click on "contact") to see how I have tried to implement this.

                  My code is as follows:

                  <!--Contact Heading-->
                  
                  <p><i><strong>Any Questions?</strong></i></p><p>Fill out the form below and we will get back to you as soon as possible.</p>
                  
                  <div style="width:100%; border-bottom:#e6e6e5 8px solid;"></div>
                  
                  <!--Contact Form-->
                  
                  <!--Form Code-->
                  
                  [[!FormIt?
                  &hooks=`email`
                  &emailTpl=`sentEmailTpl`
                  &emailSubject=`Enquiry from Caitlin Morris Images Website`
                  &emailTo=`---------------------------`
                  &validate=`contact_name:required:minLength=^2^,
                        contact_email:email:required,
                        contact_message:required`
                  &submitVar=`submit`
                  ]]
                  
                  <!--o-->
                  
                  <div id="con_form">
                     <form id="contactForm" class="cmxform" method="post" action="[[~[[*id]]]]">
                     <div style="margin-top:20px;">
                        <label for="contact_name">Name</label><br />
                        <p>[[!+fi.error.contact_name]]</p><br />
                        <input id="contact_name" class="required" name="contact_name" size="30" value="[[!+fi.contact_name]]" />      
                     </div>
                     <div style="margin-top:20px;">
                        <p>[[!+fi.error.contact_email]]</p>
                        <label for="contact_email">E-Mail</label><br />
                        <input id="contact_email" name="contact_email" size="30" class="required" value="[[!+fi.contact_email]]" />
                     </div>
                     <div style="margin-top:20px;">
                         <p>[[!+fi.error.contact_message]]</p>
                         <label for="contact_message">Your Message</label><br />
                         <textarea id="contact_message" name="contact_message" cols="70" rows="7" class="required">[[!+fi.contact_message]]</textarea>
                     </div>
                     <div>
                         <input name="submit" class="submit" type="submit" value="submit"/>
                     </div>
                     </form>
                  </div>
                          


                  Thank you very much in advance.
                    • 22019
                    • 390 Posts
                    I can’t get that form to submit at all - which may be related to the show / hide reveal using a named anchor, but I’m not sure. If you’re seeing it submit, then that discounts the most obvious issue (resource saved as Richtext, which mangles the Formit snippet parameters and shows them as ’&amp;’ instead of ’&’ ).

                    You might want to add a &successmessage=`Form submitted` or something while you’re testing (or add in a redirect hook). You could also change the ^2^ back to backticks `2` and specify an &errTpl=`[[+error]]` while testing. Sometimes I find snippets are a bit sniffy about the order of parameters, so you could move the &validate to the top.
                      Writer > E-consultant > MODx developer || Salesforce || modx 2.x || PHP 5.2.13 || MySQL client 5.0.86
                      • 21451
                      • 4 Posts
                      Hi,

                      Thank you for those suggestions, I’ll try them out and let you know how I got on.

                      The form does submit in its current state, even though it might not appear to. I received your email as proof!

                      Thanks again.