Sauter la navigation

[Résolu] Labels for checkboxes can't be clicked in forms

This support ticket is created Il y a 5 années et 6 mois. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 7:00 – 14:00 -
- 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 15:00 – 16:00 -

Supporter timezone: Europe/London (GMT+00:00)

Ce sujet contient 1 réponse, a 2 voix.

Dernière mise à jour par Nigel Il y a 5 années et 6 mois.

Assisté par: Nigel.

Auteur
Publications
#1299175
2019-07-24_09-17-44.png

I am trying to:

To create a form with a checkbox.

I expected to see:

A checkbox with a label that can be clicked

Instead, I got:

A checkbox with a label, that can not be clicked

The problem is, that labels have the "for" attribute set with a different value, than the id of the checkbox. Therefor it can't be clicked.

Solutions:
* no "for" on the label, as it encapsulates the input
* same "for" and "id" for label and input

#1299269

Nigel
Supporter

Les langues: Anglais (English ) Espagnol (Español )

Fuseau horaire: Europe/London (GMT+00:00)

Hi Adrian

I double-checked on my own test site and it is working when I add a checkbox field to a form, as the for attribute of the label and the id of the checkbox input correspond.

Can you confirm exactly what field type you include in the form?

A Types checkbox field? Or checkboxes? Or a generic field?