Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Is setting a hidden field efficient against bot? [closed]

I am fighting against future bot spamers for my newsletter form subscription. I want to keep the form simple make the procedure fast so I do not use a captcha but an hidden form to trap bots.

Is it efficient or bots know how to recognize an hidden form and will bypass it?

like image 578
torr Avatar asked Jul 29 '13 02:07

torr


1 Answers

An old question, but sharing my experience here, which I recently implemented.

  • Create some input elements which use CSS class for hiding.

         //Element to detect spam
         <input
              type="text"
              name="email"
              class="hide_me"
              id="email"
    
            />
           //Real element
        <input
              type="text"
              name="customer_email"
              id="customer_email"
              placeholder="Your Email"
    
            />
      // CSS style to hide the element    
     .hide_me{
       opacity: 0;
       position: absolute;
       top: 0;
       left: 0;
       height: 0;
       width: 0;
       z-index: -1;
    }
    
  • Use javascript to check if the email field is filled. If it is filled, it is not a real person and form submission should not be done.

like image 165
Jafar Karuthedath Avatar answered Sep 28 '22 02:09

Jafar Karuthedath