We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 7391
    • 49 Posts
    @Joric’s Method works for me. Left formit alone.
      • 14125
      • 62 Posts
      brilliant! What about one for form failure? I can’t get an error messages for invalidate input. SO a general form failure notice would work...
        • 24884
        • 1 Posts
        Guys, thx for info, but it doesn’t work properly for me... undecided
        First example is caused "1". still....
        And last one for skimmers doesn’t work.
        New snippet in elements called "snippet_name" doesn’t work.
        Last syntax php "?>" dissapearing after save and refresh.
        Then doesn’t work.
        Can u say something about it?
          • 35582
          • 1 Posts
          Try the following...
          Add a successMessage hook:

          [[!FormIt?
          &hooks=`spam,email`
          &emailTpl=`contactEmailTpl`
          ...
          &successMessage=`Thanks!`
          ]]

          Add a placeholder below the FormIt tag:

          [[+fi.successMessage]]

          Remember not to use redirect hook for it to work!

          Everything is nicely explained here:
          http://rtfm.modx.com/display/ADDON/FormIt
            • 14822
            • 61 Posts
            Quote from: netboo at Jul 28, 2011, 01:28 PM

            Try the following...
            Add a successMessage hook:

            [[!FormIt?
            &hooks=`spam,email`
            &emailTpl=`contactEmailTpl`
            ...
            &successMessage=`Thanks!`
            ]]

            Add a placeholder below the FormIt tag:

            [[+fi.successMessage]]

            Remember not to use redirect hook for it to work!

            Everything is nicely explained here:
            http://rtfm.modx.com/display/ADDON/FormIt


            Not work for me sad

            This my chunck , what is wrong?

            [[!FormIt?   
               &hooks=`recaptcha,spam,email,emailSubject`
               &recaptchaJs=`{"lang":"[[++cultureKey]]", "theme":"blackglass"}`
               &emailTpl=`ContactoEmail`
               &emailFrom=`[[+ecorreo]]`
               &emailFromName=`[[+nombre]]`
               &emailTo=`[email protected]`
               &emailSubject=`Mensaje desde el sitio web - www.jsarquitectura.com`
               &successMessage=`Thanks!`
               &validate=`
                  nospam:blank,
                  nombre:required,   
                  ecorreo:email:required,   
                  mensaje:required:stripTags`       
            ]]
            
            <div id="formcontacto">
                  <form name="formcontacto" action="[[~[[*id]]]]" method="post">  
                    <input type="hidden" name="nospam" value="" />
                    <p>
                      <label for="nombre" class="formcontacto">Nombre[[+fi.error.nombre]]</label>
                      <input name="nombre" id="nombre" type="text" tabindex="1" value="[[+fi.nombre]]" />
                    </p>
                    <p>
                      <label for="ecorreo"class="formcontacto">Correo electrónico[[+fi.error.ecorreo]]</label>
                      <input name="ecorreo" id="ecorreo" type="text" tabindex="1" value="[[+fi.ecorreo]]" />                
                    <p>
                      <span class="formcontacto">Mensaje[[+fi.error.mensaje]]</span>
                      <textarea name="mensaje" id="mensaje" cols="25" rows="7" value="[[+fi.mensaje]]" class="input-msg">[[+fi.mensaje]]</textarea>               
                    </p>
                    <p>
                      [[!+formit.recaptcha_html]]
                      [[!+fi.error.recaptcha]]
                    </p>  
                    <button type="submit">Enviar</button>
                  </form>
            </div>          
            [[+fi.successMessage]]
              • 37984
              • 215 Posts
              JoZ3 - you did not add a successMessage hook to your call.
                Jesse Couch
                MODX Aficionado, Front-End Designer & Developer
                http://www.designcouch.com
                • 37840
                • 33 Posts
                I get this message, what am i doing wrong???

                Parse error: syntax error, unexpected T_STRING in /home/content/54/8603754/html/modx/core/cache/includes/elements/modsnippet/31.include.cache.php on line 7
                  • 42270
                  • 16 Posts
                  d.helfensteller Reply #18, 8 years ago
                  I had some issues today too

                  • math-hook was working before using &successMessage=`` and its fi.successMessage
                  • when switching to recaptcha-hook, fi.successMessage would stay empty even if form validates correctly incl reCaptcha

                  So as Bob explained I created a custom snippet "formitSuccess", but setting a placeholder WITHOUT the fi. - prefix:

                  $modx->setPlaceholder('successMessage','Form submitted successfully.');
                  return true;


                  Inside FormIt-template (avoid the fi.-prefix !):

                  [[!FormIt?
                     &hooks=`recaptcha,spam,email,formitSuccess`
                     ...
                  ]]
                  
                  [[!+successMessage:notempty=`[[!+successMessage]]`]]
                  [ed. note: d.helfensteller last edited this post 8 years ago.]
                  • Quote from: netboo at Jul 28, 2011, 08:28 AM

                    [[+fi.successMessage]]

                    This placeholder needs to be called uncached: [[!+fi.successMessage]]
                      • 42601
                      • 24 Posts
                      What about adding a progress loading when its submitting (takes up to 15 seconds to send) an inpatient person will leave the page assuming it has sent.