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

    I've been banging my head against wall for some time with this.

    I don't understand why contact form doesn't work for me.

    Call:
    [[!FormIt? 
    &hooks=`email,redirect` 
    &emailTpl=`sentEmailTpl` 
    &emailSubject=`Message` 
    &emailTo=`my email address` 
    &validate=`Name:required:minLength=`2`, 
    	Email:email:required, 
    	Message:required` 
    &redirectTo=`1`
    &language=`en` ]]
    
    <div id="contact-area">
    <form id="commentForm" action="[[~[[*id]]]]" method="post">
    
    	<label for="Name"><strong>Name:</strong> <span class="error">[[!+fi.error.Name]]</span></label> 
        <input id="Name" class="required" type="text" name="Name" value="[[!+fi.Name]]" /> 
        
        <label for="Email"><strong>E-mail:</strong> <span class="error">[[!+fi.error.Email]]</span></label> 
        <input id="Email" class="required email" type="text" name="Email" value="[[!+fi.Email]]" /> 
        
        <label for="Message"><strong>Message:</strong> <span class="error">[[!+fi.error.Message]]</span></label>
        <textarea id="Message" class="required" name="Message" rows="40" cols="20">[[!+fi.Message]]</textarea> 
        
        <input class="submit-button" type="submit" name="submit" value="Send" /></form>
    
    </div>
    


    This form is copied from another site, along with sentEmailTpl and css, where it works great.
    I ran this site through w3c, and there were no errors
    I tried applying basic template, with no scripts and css, to see if there were any compatibility issues

    When I press send even redirect doesn't happen.
      • 36461
      • 102 Posts
      Anyone ?
        • 28215
        • 4,149 Posts
        &validate=`Name:required:minLength=`2`, 
            Email:email:required, 
            Message:required` 


        is wrong. You should be doing:

        &validate=`Name:required:minLength=^2^, 
            Email:email:required, 
            Message:required`


        Also, you should add &submitVar=`submit` to your call.
          shaun mccormick | bigcommerce mgr of software engineering, former modx co-architect | github | splittingred.com
          • 36461
          • 102 Posts
          I did these things

          [[!FormIt? 
          &hooks=`email,redirect` 
          &emailTpl=`sentEmailTpl` 
          &emailSubject=`Message` 
          &emailTo=`my email address` 
          &validate=`name:required, 
          	email:required, 
          	message:required` 
          &submitVar=`submit`
          &redirectTo=`1`
          ]]
          


          But it still this form doesn't work.
          I also tried re-installing formit and clearing cache several times, but nothing helps.

          Just I wild idea, would it be possible, that formit doesn't work because of babel and .htaccess ?
          [ed. note: viltnieks last edited this post 14 years, 11 months ago.]
            • 3749
            • 24,544 Posts
            Try it without the validate property.
            The field names are still wrong there, but first see if it works without any
            validation.

            If not, try installing QuickEmail to see I'd the mail function is working.
              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
              • 36461
              • 102 Posts
              I removed validate property, but it still didn't work.

              I installed QuickEmail and followed instructions. E-mail was sent, and I received it in my inbox as well.

                • 3749
                • 24,544 Posts
                Sorry, I'm out of ideas.
                  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
                  • 36461
                  • 102 Posts
                  Guess I will try re-installing modx
                    • 36461
                    • 102 Posts
                    After second thought, I really wouldn't like to try re-installing.

                    I have made my form really simple just send e-mail and redirect, but still it doesn't work for me.
                    Could you please help me to get this working.
                    I did everything exactly the same as in other sites and forms there work great.
                    I also upgraded to modx revo 2.1.5

                    [[!FormIt? 
                    &hooks=`email,redirect`
                    &submitVar=`submit` 
                    &emailTpl=`sentEmailTpl` 
                    &emailSubject=`Zinojums no majas lapas` 
                    &emailTo=`my email` 
                    &redirectTo=`1`
                    ]]
                    
                    <div id="contact-area">
                    <form id="commentForm" action="[[~[[*id]]]]" method="post">
                    
                    	<label for="Name"><strong>Vards:</strong> <span class="error">[[!+fi.error.Name]]</span></label>
                        <input id="Name" class="required" type="text" name="Name" value="[[!+fi.Name]]" /> 
                        
                        <label for="Email"><strong>E-pasts:</strong> <span class="error">[[!+fi.error.Email]]</span></label> 
                        <input id="Email" class="required email" type="text" name="Email" value="[[!+fi.Email]]" /> 
                        
                        <label for="Message"><strong>Zinojums:</strong> <span class="error">[[!+fi.error.Message]]</span></label>
                        <textarea id="Message" class="required" name="Message" rows="40" cols="20">[[!+fi.Message]]</textarea> 
                        
                        <input class="submit-button" type="submit" name="submit" value="submit" />
                        
                    </form>
                    </div>
                    
                      • 3749
                      • 24,544 Posts
                      Sorry, I don't see anything wrong with your code.

                      Does any of the fields contain any accented characters? If so, it could be a character set issue.


                      You might try removing FormIt (right-click on it in Package Manager and select "Remove Package"). Then re-download it and re-install it.
                        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