We launched new forums in March 2019—join us there. In a hurry for help with your website? Get Help Now!
    • 25663 MODX Staff
    • 12,272 Posts
    http://bjorkoy.com/past/2007/8/1/battle_comment_spam_with_an/

    Synopsis: An interesting anti-spam measure by adding a CSS-hidden fake "lastname" form field that still should be visible to spambots. If it’s filled in, don’t accept the form submission, or accept it but just don’t actually do anything with the submission.

    Could make for an interesting alternative to Captcha (which in our implementation has just as many accessibility issues for screen readers). Comments worthwhile to peruse too. This would be great in combination with the flood controls from Jot...
      Ryan Thrash, MODX Co-Founder
      Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
      • 3749
      • 24,544 Posts
      Quote from: rthrash at Aug 06, 2007, 02:19 PM

      http://bjorkoy.com/past/2007/8/1/battle_comment_spam_with_an/

      Synopsis: An interesting anti-spam measure by adding a CSS-hidden fake "lastname" form field that still should be visible to spambots. If it’s filled in, don’t accept the form submission, or accept it but just don’t actually do anything with the submission.

      Here’s perhaps a better way I found. Rather than use display:none, it puts the div off the screen and shrinks it so it’s more-or-less invisible even in browsers that don’t honor the position. Google reportedly frowns on disply:none in its rankings.

      CSS:

      .my_input {
      position:absolute;
      text-decoration:underline;
      background-color:#CC0000;
      left:0px;
      top:-500px;
      width:1px;
      height:1px;
      overflow:hidden;
      }

      HTML:
      echo '<div class="my_input">',
      '<table><tr><td>Please refrain from entering<br> your Last Name here:</td><td>',
      '<input type="text" name="lastname" size=30 ></td></tr></table></div>';
      }

      I’d credit the creator but I can’t find the reference.

      Bob
        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
        • 14050
        • 788 Posts
        Does anyone have an example of how this would be implemented with eForm?
          Jesse R.
          Consider trying something new and extraordinary.
          Illinois Wine

          Have you considered donating to MODx lately?
          Donate now. Every contribution helps.
          • 4626
          • 57 Posts
          A problem with this method is the the browsers auto-fill of form fields. Even though you are real person the browser could think it is doing it’s job and fills in the lastname even though it isn’t visible thereby invalidating your submission – not good.
            • 3749
            • 24,544 Posts
            Quote from: carlholmberg at Oct 09, 2007, 04:25 PM

            A problem with this method is the the browsers auto-fill of form fields. Even though you are real person the browser could think it is doing it’s job and fills in the lastname even though it isn’t visible thereby invalidating your submission – not good.

            Good point. I use Roboform (and highly recommend it -- http://roboform.com) and I suspect that it would fill this field for most people without them knowing it. Maybe ’Last__Name’ would prevent the autofill but still snare the spammers.

            I have a working simple contact form snippet that uses this technique. I’ll post in the snippet "in development" forum if I ever have time to finish the docs bundle it up .

            Bob
              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
              • 25663 MODX Staff
              • 12,272 Posts
              You can prevent autocomplete of certain form fields in most browsers by adding autocomplete="off" to your input tags like:
              <input autocomplete="off" type="text" value="" name="lastname" id="lastname" />
                Ryan Thrash, MODX Co-Founder
                Follow me on Twitter at @rthrash or catch my occasional unofficial thoughts at thrash.me
                • 3749
                • 24,544 Posts
                Quote from: rthrash at Oct 10, 2007, 09:53 AM

                You can prevent autocomplete of certain form fields in most browsers by adding autocomplete="off" to your input tags like:
                <input autocomplete="off" type="text" value="" name="lastname" id="lastname" />


                Cool. I’ll have to check and see if that stops Roboform. Putting autocomplete="off" in the hidden field and in one real required field (e.g. subject) should foil a lot of spammers.

                Bob


                  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
                  • 4971
                  • 964 Posts
                  What about just requesting an easy arithmetic operation as captcha to the user? like 2 + 2 = ?
                  Randomize the numbers and the operators (+, - and *)...
                    Website: www.mercologia.com
                    MODX Revo Tutorials:  www.modxperience.com

                    MODX Professional Partner
                    • 3749
                    • 24,544 Posts
                    Quote from: charliez at Oct 16, 2007, 04:19 PM

                    What about just requesting an easy arithmetic operation as captcha to the user? like 2 + 2 = ?
                    Randomize the numbers and the operators (+, - and *)...


                    I like it. I’m working on an ultra-spamproof contact form. I’ll see if I can work that in as an option in addition to the hidden field. I realized that if I just obfuscated the hidden field’s id a little(e.g. Last..Name) it would stop autofill.

                    Bob
                      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