It’s common for web developers to use CAPTCHA (Completely Automated Public Turing test to tell Computers and Humans Apart) functionality for anti-spam verification to make sure HTML form responses are being generated by humans and not computer “bots”.
The most commonly used CAPTCHA presents a visual of distorted text for the website visitor to interpret. Another alternative is the audio CAPTCHA, offering human verification to the blind and other visually impaired people. Unfortunately, both types of CAPTCHAS offer accessibility issues:
- People with visual disabilities use screen readers that cannot read a CAPTCHA.
- You cannot add ALT text to a CAPTCHA image, because then a bot would be able to read it, defeating the purpose of using it.
- Audio CAPTCHAs present difficulties for people with hearing disabilities.
SOLUTION: Use Text-based Logic Questions or Math Equations CAPTCHAs
Use a question rather than an image or audio to create CAPTCHA functionality.
A sample CAPTCHA question might be “Which animal is larger—an ant or a elephant?”or “What state is Boston located in?”
Another way to challenge: use math questions (e.g. “What is one plus three?”).
PHP Script Solution: All CAPS vs lowercase
For those of you who use PHP, here’s a simple coding trick that enables you to create an accessible CAPTCHA on an HTML form. I have used this for years on client websites, and it works great.
At the bottom of your form, create a text field named Validate. Above the field, add a validation text code of capital letters and numbers (in this case GHW53405) that the user will need to enter in order to submit the form. Also let the user know that the validation code is case-sensitive.
Once the user enters the validation text code and submits the form, add the following condition at the top of the PHP processing page:
<?php
if (strtolower($_POST[‘Validate’]) != ‘ghw53405′) {
die(‘Sorry…you forgot to enter the special code in the form…hit your back key and try again. Please note that the special code is case-sensitive’);
} else {
rest of script
}
Note that in the PHP condition you need to change the values of the capital letters used in the validation text code to lowercase (see bold above). The PHP function strtolower converts all the text characters of the submitted Validate string to lowercase. If the validation text code has been entered correctly, the rest of the script will process with no problem. If the validation code has been entered incorrectly, the submission will fail and the user will be directed back to the form.
Check Out This Additional Resource: The TextCaptcha service provides access to textual CAPTCHA challenges via a simple JSON or XML API over HTTP. http://textcaptcha.com
===
WEBSITE ACCESSIBILITY TESTING & REMEDIATION SERVICES: Mary Gillen is an experienced Website Accessibility Compliance Auditor and Remediator. She can test your website to determine if it meets accessibility standards:
WCAG 2.1: 118 checkpoints covering A, AA and AAA W3 accessibility guidelines
Section 508: 15 US federal guidelines covered by 55 accessibility checkpoints
Find out more about Mary Gillen’s Accessibility Testing & Remediation Services: Websites, PDFs, Office Docs & Videos
===