Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add tabindex="-1" via Javascript, in Plone 6 #9

Open
MrTango opened this issue Sep 7, 2022 · 0 comments
Open

Add tabindex="-1" via Javascript, in Plone 6 #9

MrTango opened this issue Sep 7, 2022 · 0 comments

Comments

@MrTango
Copy link

MrTango commented Sep 7, 2022

Since the hidden formfield is not a real field, it should have tabindex="-1" set.
But to make it not to easy for the spammers to find it, it should be set via Javascript.
We could do this directly in the template we have, but for Plone 5 the following would fail because of requirejs:

<script type="text/javascript">
  document.querySelector("#formfield-form-widgets-${view/honeypot_field_name}")[0].setAttribute("tabindex", "-1");
</script>

i suggest to only add this for the next major which should be Plone >= 6.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant