We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 12379
    • 460 Posts
    Keen to use a math style of question to prevent spam on a contact form. Anybody been able to do this with eForm and if so, how? Am aware of SPForm but I’ve spent a bit of time configuring eform (with additional functions, etc) so would prefer to stick with it for the time being.
      Mostly harmless.
    • It shouldn’t be difficult to port SPForm’s math check function; I used their dummy empty form field (moved off the viewport with extreme CSS) quite easily, using this snippet and a parameter &eformOnValidate=`checkField`.

      <?php
      function checkField(&$fields,&$vMsg,&$rMsg) {
          if(!empty($fields['Last__Name'])) {
              return false;
          } else {
          return true;
          }
      }
      ?>
        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
        • 12379
        • 460 Posts
        Ace. Thanks.
          Mostly harmless.
          • 37099
          • 338 Posts
          Ah cool I was wondering how to do that smiley

          Up till now I have used spform which has been brilliant, as I like it’s ani-spam features without having to use CAPTCHA stuff which I don’t like - not good for user experience.

          But it seems more people use eform, (maybe because it’s easier to change the structure of the contact form) but it didn’t seem to have the same alternatives to CAPTCHA.

          Now we just need to port the stuff that detects keyboard and mouse use.

          Cheers
          Mike
            • 12379
            • 460 Posts
            OK, tabbing through the form fields is interesting as the focus goes missing for that field. Is there any way of skipping that input field and automatically forcing to the next field? And if so, will this aid the spambots to miss the decoy field?
              Mostly harmless.
              • 12379
              • 460 Posts
              Just figured the skipping tab bit:

              <input type="text" tabindex="-1" name="Last__Name" id="LastName" size="30" autocomplete="off" eform="Spam::0:Rejected:#FUNCTION checkField" />
                Mostly harmless.
                • 12379
                • 460 Posts
                Would the above solution for tabindex cause spambots to skip that field I wonder?
                  Mostly harmless.
                • I doubt it; I did that on my site a long time ago and I haven’t gotten any form spam at all.

                  Actually, taking a look at my tpl, I used a tabindex of 50 for that field. That seemed to be a sufficiently ridiculous number that shouldn’t ever cause a problem.
                    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
                    • 26027
                    • 145 Posts
                    Hi Susan. I hope you're still tracking this three year-old item. I used the somewhat standard empty field honeypot and it has worked very well for me for a couple years now. Your help in another thread got it working for me.

                    In this thread you commented that you made the honeypot field invisible by having CSS move it off the viewport. My way of making it invisible was to use 'display: none'.

                    I have some unwanted spambot activity from time to time and was wondering if some spambots are hip to 'display: none' and whether I would do better with CSS that located the field off the viewport.

                    Will that produce a better result for me Susan?

                    Thanks again for your help ... Sam