Browser: Chrome, Firefox
OS: Windows
Autocomplete attribute in honeypot field has a value “nope”, instead of “off”. And we cannot change it because autocomplete field is ignored then honeypot is active
Browser: Chrome, Firefox
OS: Windows
Autocomplete attribute in honeypot field has a value “nope”, instead of “off”. And we cannot change it because autocomplete field is ignored then honeypot is active
Hi,
This was a dilemma when creating a honeypot solution. But in my testing, the off
attribute was less effecting than nope
.
Anyway, you can change it with the following filter. Just make sure that you add some conditions and check if the field attribute exists.
field-0
is the first first in the form. If you are changing the second one, you have to increment the number.
add_filter(
'bricks/element/render_attributes', function ( $attributes, $key, $element ) {
$attributes['field-0']['autocomplete'] = 'off';
return $attributes;
}, 10, 3
);
Let me know if you need more help.
Additionally, can you tell me how you tested, so that form was autocompleted?
Thanks,
Matej
Interesting. I’m just can’t find a ‘nope’ value nor in MDN article nor in HTML standards. It’s either boolean ‘on/off’ or a token like ‘tel’ or ‘name’
Yeah, the idea is that “nope” is unrecognized value, so autocomplete will/should not fill it. But it’s true that there is no singular solution for this. Should be “off”, but yeah…
If you find that there is an issue with “nope”, you can change it with the filter above, but if we will notice that “off” works, then we will change it in the future, of course.
Best regards,
Matej