User tests: Successful: Unsuccessful:
Pull Request resolves #43248 .
Radio fields and checkbox fields are fieldsets and currently render both a and a within their
. The label targets the fieldset itself, which is not a labelable form control and is therefore both redundant and semantically incorrect.This crazy simple approach compared to #48591 works much much better. Instead of a <label> it now formats it as a <span>
This means that the visual display doesnt change and the invalid markup is replaced
Either create radio and checkbox custom fields or check any existing fields of this type within Joomla
Inspect the code for the radio and checkbox
there is an scss and js change so use a pre-built package or npm i
Note the label and the for= - this is invalid markup
The label has been replaced with a span and the for= is removed
Please select:
Documentation link for guide.joomla.org:
No documentation changes for guide.joomla.org needed
Pull Request link for manual.joomla.org:
No documentation changes for manual.joomla.org needed
| Status | New | ⇒ | Pending |
| Category | ⇒ | Layout |
I have tested this item π΄ unsuccessfully on 501d2f7
I have tested this item π΄ unsuccessfully on 501d2f7
I have tested this item π΄ unsuccessfully on 501d2f7
Needs changes β radio fields get the <span>, but checkboxes are not covered, required radio fields lose their inline validation message, and the label text changes colour.
Test fields: custom fields "Test Radio" (radio, required) and "Test Checkboxes" (checkboxes, required) on articles.
| Check | Before | With PR |
|---|---|---|
| Radio field markup | <label id="β¦-lbl" for="fieldset-id"> |
β
<span id="β¦-lbl">, required * kept |
| Articles β Options | 55 <label for> pointing at a fieldset |
β 0, 55 spans |
| Checkboxes field markup | <label id="β¦-lbl" for="fieldset-id"> |
β unchanged (Finding 1) |
| Save article with both required fields empty | both labels red + "One of the options must be selected" | β radio: no message, label not red (Finding 2) |
| Label text colour (Atum) | rgb(0, 27, 76) |
β radio: rgb(73, 80, 87) (Finding 3) |
| Subform with a radio field, add 2 rows (Plugins β FileSystem - Local) | no duplicate ids | β duplicate id (Finding 4) |
Title, description and testing instructions say radio and checkboxes. The check is $field instanceof RadioField; CheckboxesField extends ListField, so its label is still <label for="fieldset-id">. Same for RadiobasicField (also extends ListField, also renders a fieldset; from the code, not tested).
The description also says the id is removed. The id is still there; only for is removed.
validate.js finds the label with label[for="<fieldset id>"], adds the class invalid and appends the message to it (markInvalid, markValid, removeMarking). Without for nothing is found: the radio field only gets the generic alert at the top, while the checkboxes field next to it still shows "One of the options must be selected" in red.
Atum colours label elements, the span inherits the .control-label colour instead: radio labels are now grey (rgb(73, 80, 87)) next to dark blue labels of all other fields (rgb(0, 27, 76)). In the article sidebar "Featured" becomes rgb(33, 37, 41). Position and font size are unchanged.
joomla-field-subform renumbers the group label of a radio fieldset with row.querySelector('label[for="<old id>"]'). The span is not found, so every added row keeps the template id. After adding two rows in Plugins β FileSystem - Local the id jform_params__directories__directoriesX__thumbs-lbl exists twice.
Findings 2 and 4 need the two scripts to find the element by id (#<fieldset id>-lbl) instead of label[for]; Finding 3 needs the label colour rule (and label.invalid) to apply to the span, e.g. via a class on it.
"Before" = same test site with renderlabel.php from 6.2-dev. Test fields: custom fields "Test Radio" and "Test Checkboxes" (both required) on articles. All at 1440px, Atum.
Article saved with both required fields empty. Before: both labels turn red and show "One of the options must be selected". After: only the checkboxes field does, "Test Radio" stays unmarked.
| Before | After |
|---|---|
![]() |
![]() |
Before: "Test Radio" has the same dark blue as every other label. After: it is grey (rgb(73, 80, 87) instead of rgb(0, 27, 76)), "Test Checkboxes" below it is unchanged.
| Before | After |
|---|---|
![]() |
![]() |
Same effect on the options page: the labels of the switches ("Title", "Linked Titles", "Intro Text" β¦) are grey, the labels of the select fields ("Choose a Layout", "Position of Article Info") stay dark blue. Position and font size are unchanged.
| Before | After |
|---|---|
![]() |
![]() |
Thanks @tecpromotion i didnt think to check the colour or the highlighting on error. I will look into that
The checkboxes was my fault - I forgot to commit the last change (I have done now)
I have also corrected my description about the id being removed - it was of course the for= that is removed
| Labels |
Added:
PR-6.2-dev
|
||
| Category | Layout | ⇒ | Layout NPM Change |
| Labels |
Added:
NPM Resource Changed
|
||
| Category | Layout NPM Change | ⇒ | Layout JavaScript NPM Change Front End Templates (site) |
This pull request has conflicts, please resolve those before we can evaluate the pull request.
| Labels |
Added:
Conflicting Files
|
||
| Status | Pending | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2026-10-09 17:19:16 |
| Closed_By | ⇒ | brianteeman |
| Status | Closed | ⇒ | New |
| Closed_Date | 2026-10-09 17:19:16 | ⇒ | |
| Closed_By | brianteeman | ⇒ |
| Status | New | ⇒ | Pending |
| Category | Layout NPM Change JavaScript Front End Templates (site) | ⇒ | Layout JavaScript NPM Change |
jiust need to look at the subforms now from @tecpromotion report as everything else should be fixed
| Labels |
Removed:
Conflicting Files
|
||
@tecpromotion i believe all the issues you raised have now been resolved
@tecpromotion i believe all the issues you raised have now been resolved
@brianteeman all four findings from my first test are resolved. One cosmetic leftover: the required * no longer turns red with an invalid label (one-line fix below).
| Finding from the first test | 501d2f7 | 327340c |
|---|---|---|
| 1 β checkboxes not changed | β | β
<span id="β¦-lbl"> for radio and checkboxes, no for, * kept |
| 2 β no inline validation message | β | β red label + "One of the options must be selected" for both; removed again after selecting an option and saving |
| 3 β label colour grey instead of dark blue | β | β
rgb(0, 27, 76), white in dark mode β same as <label> |
| 4 β duplicate id after adding subform rows | β | β
none; added rows get β¦directories2__thumbs-lbl, β¦directories3__thumbs-lbl |
Also checked:
<label for> pointing at a fieldset, 55 spans.eslint and stylelint on the changed files: clean.* stays dark blue in an invalid label (Atum).control-label span:not(.invalid):not(.valid):not(.form-control-feedback) also matches the nested span.star. Save a new article with an empty Title:
| Before | With PR | |
|---|---|---|
| "Title" | red | red |
* |
red rgb(197, 40, 39) |
rgb(0, 27, 76) (dark mode: white instead of rgb(224, 97, 92)) |
| "Please fill in this field" | red | red |
Same for the * of the radio and checkboxes spans. Matching only the direct child fixes it (tested, light and dark: label, * and message are all red, normal state unchanged):
> span:not(.invalid):not(.valid) {
color: var(--login-label-color);
}css changes made
![]()
@brianteeman your screenshot shows the red * β nice. I think the commit for it may not be pushed yet: the PR head is still 327340c from 9 October, and there the * is still rgb(0, 27, 76). Happy to re-test as soon as it's up.
@tecpromotion refreshed but i think you were wrong as github showed that the css change was committed after the head you refer to
I have tested this item β
successfully on 7354c4e
@brianteeman thanks. 649e2dd is dated 10 October, but it reached the PR with today's push at 13:47 UTC (327340c β 7354c4e); GitHub sorts the commits by commit date, so it looks older than it is here.
I have tested this item β
successfully on 7354c4e
@brianteeman thanks. 649e2dd is dated 10 October, but it reached the PR with today's push at 13:47 UTC (327340c β 7354c4e); GitHub sorts the commits by commit date, so it looks older than it is here.
@tecpromotion it would be great if you could test again this version - much much simpler code with no css changes