No error highlighting on form checkbox or radio input types

Created on 16 February 2008, almost 17 years ago
Updated 12 December 2023, about 1 year ago

Problem: Browsers do not allow CSS styling of checkbox or radio form input types.
Cause: Current browser adoption of CSS standards do not allow styling of checkbox or radio types.
Testing config: Drupal 5.7, WinXP, Firefox2, IE7

The Drupal 'form_set_error()' function generates an error message for the top of the page and highlights the contents of the field which contains the error in red. Trouble is that highlighting of the input element does not work. From what I can find this bug has a Mozilla 'wontfix' status at present and a maybe for CSS3. See http://forums.mozillazine.org/viewtopic.php?t=388153 for more info.

In light of this situation could the error highlighting for these input form types be placed on the label element around inputs that use the checkbox or radio types? This would be better than nothing...

Any ideas as to how to deal with this issue?

Thanks,
Doug

------------------------------------------------
Example - present application of error highlighting "checkbox" type:
Note that 'error' is added to the input class. In the modified function 'error' would be appended it to the label class instead.

  <label class="option">
    <input type="checkbox" name="field-31[65-point vehicle maintenance inspection]" id="edit-field-31-65-point-vehicle-maintenance-inspection" value="65-point vehicle maintenance inspection" class="form-checkbox error" /> 65-point vehicle maintenance inspection</label>

Example - modified placement of error highlighting for "checkbox" type:

  <label class="option error">
    <input type="checkbox" name="field-31[65-point vehicle maintenance inspection]" id="edit-field-31-65-point-vehicle-maintenance-inspection" value="65-point vehicle maintenance inspection" class="form-checkbox" /> 65-point vehicle maintenance inspection</label>
๐Ÿ› Bug report
Status

Closed: cannot reproduce

Version

9.1

Component
CSSย  โ†’

Last updated 5 days ago

Created by

๐Ÿ‡จ๐Ÿ‡ฆCanada WiredEscape

Live updates comments and jobs are added and updated live.
  • CSS

    It involves the content or handling of Cascading Style Sheets.

  • Usability

    Makes Drupal easier to use. Preferred over UX, D7UX, etc.

  • Needs backport to D7

    After being applied to the 8.x branch, it should be considered for backport to the 7.x branch. Note: This tag should generally remain even after the backport has been written, approved, and committed.

  • Accessibility

    It affects the ability of people with disabilities or special needs (such as blindness or color-blindness) to use Drupal.

  • Needs issue summary update

    Issue summaries save everyone time if they are kept up-to-date. See Update issue summary task instructions.

Sign in to follow issues

Comments & Activities

Not all content is available!

It's likely this issue predates Contrib.social: some issue and comment data are missing.

Production build 0.71.5 2024