Welcome to the Treehouse Community
Want to collaborate on code errors? Have bugs you need feedback on? Looking for an extra set of eyes on your latest project? Get support with fellow developers, designers, and programmers of all backgrounds and skill levels here with the Treehouse Community! While you're at it, check out some resources Treehouse students have shared here.
Looking to learn something new?
Treehouse offers a seven day free trial for new students. Get access to thousands of hours of content and join thousands of Treehouse students and alumni in the community today.
Start your free trial
Brandon Brigham
3,716 PointsLooking for javascript-based CAPTCHA code
Hey guys,
So I've been asked to add a CAPTCHA to an existing form on a website. Apparently it needs to be javascript-based and coded on the front-end due to the way the client's site is set up.
Does anyone know a good one to use.
She doesn't want to use Google's reCAPTCHA and I've already tried this one but it didn't work: http://www.tothemoon.com/2013/01/simple-javascript-captcha-you-can-add-to-any-form/
Thanks!
3 Answers
Andrew Dunn
14,718 PointsYou know, the best kind of CAPTCHA I've implemented is one that's invisible to users, called a Honeypot:
http://www.sitepoint.com/honeypot-captcha/
Several years ago I started using the popular Securimage CAPTCHA which worked reasonably well at the time, however:
- It was really annoying to users
- To make it mildly accessible you had to disable most of the techniques for fooling computers
- It was complicated to install initially
Fairly recently I learned that the very jarring user-input CAPTCHA's were becoming a bit tired and old-hat, and that the Honeypot was a fairly reasonable, no-nonsense approach, and I've had tremendous success implementing these in sites. The great thing is that they're easy to implement, and you don't have to rely on someone else's popular (and therefore easily hackable) code - and with some JS knowhow you can improve on the concept by building forms with JS, adding server side session challenges and more. So long as the web bot isn't rendering the page and using that as its mechanism for filling out forms, you're save - and most malicious bots go for the direct approach by reading the raw HTML.
Good luck!
Dustin Matlock
33,856 PointsI've never really been satisfied with captchas, so I'm just going to recommend one open source project which looks pretty decent.
James Barnett
39,199 PointsYou can do something like this (very) simple HTML-only captcha, but ask a question harder for a computer to parse.
Dustin Matlock
33,856 PointsDustin Matlock
33,856 PointsDid you by chance keep the honeypot name?
Andrew Dunn
14,718 PointsAndrew Dunn
14,718 PointsI just took inspiration from the sweet sounding source, it's still a CAPTCHA, just a different form ;)