Skip to content
View in the app

A better way to browse. Learn more.

Web Designer Forum

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

can spam bots follow $.click() handlers?

Featured Replies

I have been thinking of incorporating captcha into a form I am creating to prevent spam, but as the form is quite complex, captcha is going to be a nightmare to incorporate, and I also think it looks terrible on a website

 

But I have been thinking, what is it that spam bots look for, is it the :

 

<input type="submit" value="Submit"/>

 

?

 

If so I have an image as the submit button with a $.click() handler in an external js file to handle the event. Would spam still be able to submit the form wihout captcha?

Edited by pilgrim_fgau

CAPTCHA's also a usability nightmare, but I wouldn't recommend using Javascript to submit your form; there are better ways. Try this instead:

  1. Add an extra text input field to the beginning of your form, with a common name that you're not actually using for your form. If you use "firstname" and "lastname", call it "name". If you use "name", call it "firstname".
  2. Hide the field using display:none in CSS (important to do it this way instead of using a hidden form field - the important thing is that the HTML should look like a normal form field to a spambot, but users shouldn't see it. Most screenreaders also respect display: none)
  3. Have your server-side form processing script discard any form submissions that have that field filled in.

Genuine users will not see that field, and thus will leave it blank. Spambots will attempt to fill it in, because "name" or "firstname" will be common field names that they'll be programmed to fill.

CAPTCHA's also a usability nightmare, but I wouldn't recommend using Javascript to submit your form; there are better ways. Try this instead:

  1. Add an extra text input field to the beginning of your form, with a common name that you're not actually using for your form. If you use "firstname" and "lastname", call it "name". If you use "name", call it "firstname".
     
  2. Hide the field using display:none in CSS (important to do it this way instead of using a hidden form field - the important thing is that the HTML should look like a normal form field to a spambot, but users shouldn't see it. Most screenreaders also respect display: none)
     
  3. Have your server-side form processing script discard any form submissions that have that field filled in.

Genuine users will not see that field, and thus will leave it blank. Spambots will attempt to fill it in, because "name" or "firstname" will be common field names that they'll be programmed to fill.

Aren't you clever eh.

Aren't you clever eh.

 

Yup, he is! That's why he's a respected moderator on one of the of the most popular web design forums on the internet who's contributions to this community have received one of the highest ratios of posts to upvotes/reputation.

Yup, he is! That's why he's a respected moderator on one of the of the most popular web design forums on the internet who's contributions to this community have received one of the highest ratios of posts to upvotes/reputation.

 

Ok, you've either done something or you want something...

 

Edit: or you had a false positive on your sarcasm detector. 99% certain it was sincere, cos my post got +Repped at about the same time Samus posted. Wasn't the OP, cos he hasn't been back since.

Edited by Renaissance-Design

Create an account or sign in to comment

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.