3 ms·
I have had success with a simple hack to the forms. I rename one of the fields (usually the email address) and then add a fake hidden field named "email". If th
by gregjor 6y ago
I have had success with a simple hack to the forms. I rename one of the fields (usually the email address) and then add a fake hidden field named "email". If the form gets submitted with something in the fake field the back-end code ignores the form submit.
<input type="text" name="email" style="display:none;">
<label>Your email address</label>
<input type="text" name="fax">
The back-end looks for the real email address in the "fax" field, and silently ignores the form submit if it sees anything in the "email" field.
I don't remember where I saw this trick a few years ago, I didn't think of it myself. It has worked pretty well on multiple sites that have exposed "Contact us" forms.
- whatch 6y agoInteresting solution. Unfortunately, it seems it doesn't play nice with screen readers.
- gregjor 6y agoI have this solution in a "contact us" form on an ADA-compliant site. A combination of title and aria-* attributes make it accessible to screen readers, a legal requirement for that web site.