Currently theme_checkboxes() and theme_radios() do not make use of _form_set_class() like other form elements, so they do not receive error classes or required classes as necessary. As these elements may be required, these classes are needed in order to visibly style the error'd group just like other form elements are.
| Comment | File | Size | Author |
|---|---|---|---|
| drupal-6-3-form-error-classes-v1.patch | 1.55 KB | Moonshine |
Comments
Comment #1
Moonshine commentedActually I'll mark this as a minor bug, as it does seem to be an inconsistancy in the form validation UI.
Comment #2
dpearcefl commentedDoes this issue exist in current D6?
Comment #3
dpearcefl commentedComment #4
kndrPatch works. I can confirm this bug. Implications are deep and I've wasted couple of hours because of this bug. Finally I've made exactly the same patch. It is pity that I didn't find this issue earlier. I am using Vertical Tabs and this bug causes me big problem with tabs, which should be activated when some of their elements didn't pass validation. Look at #1108574: "required indicator" dont show when CCK-TextField is "Checkboxes/radio buttons"? Class 'error' should be added to checkboxes and radios element too since property #required is set for this elements. Look at function optionwidgets_buttons_process inside optionwidgets module: http://drupalcontrib.org/api/drupal/contributions--cck--modules--optionw... Property #required is set for checkboxes. It is obvious, that element checkboxes should be selected as invalid (with class 'error') when validation fails. Without this patch we have inconsistent behavior and other modules (like Vertical Tabs) has no chance to work properly.
Comment #6
Everett Zufelt commenteddrupal-6-3-form-error-classes-v1.patch queued for re-testing.
Comment #7
Everett Zufelt commentedComment #9
kndrOne notice. If you don't want to patch the core you could use theme functions inside template.php of YOUR_THEME
Comment #10
Moonshine commentedWow, this is still present in D7. :( If I cook up a new patch is there a chance to get it in a maintenance release?
Comment #11
jackbravo commentedThis would be the patch for D7. But it also needs theming changes so I wouldn't applied it as is. system.messages.css which contains this line:
Also, this seems to be a duplicate of #222380: No error highlighting on form checkbox or radio input types. So I think this should be closed instead anyway =P.