Skip to content

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

Open
@MrTango

Description

@MrTango

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.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions