Aria-hidden on a Honey Pot field
I have a honey pot input field on a form to prevent bots from submitting it, hidden with absolute positioning. I would like assistive technologies such as screen readers to ignore the honey pot field, so I added the aria-hidden="true" to it.
Will adding the aria-hidden="true" attribute to my honey pot field prevent bots from filling it in, similar to adding a "display:none" property? Or will they still fall for the trap and fill in the field?
Form fields are tab focusable, so while adding aria-hidden will not cause the field to be announced, it will still receive focus when a screen reader user tabs through the page.
This will cause confusion because the screen reader will not read out any label for the field. To solve this problem, you could add tabindex="-1" to take the field out of the natural tab order. I am not sure, however, whether that will cause it to be ignored by the bots.
Will adding the aria-hidden="true" attribute to my honey pot field prevent bots from filling it in?
No. They read Stackoverflow like everyone. After reading your message, they will update their algorithm and ignore aria-hidden=true fields ;-)
Of course not. As long as this solution can be skirted, writing it publicly does not give you the benefit of security through obscurity.
EDIT: added a smiley (but this is however a serious answer)
EDIT 2: added a second sentence for people lacking of humor