No error highlighting on form checkbox or radio input types
| Project: | Forms |
| Version: | 5.x-1.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
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>
#1
Forms and survey modules are no longer being maintained, use Webform module instead.
---Closing down issue queue of survey module---