checkbox XHTML validity
stBorchert - June 25, 2007 - 08:34
| Project: | Todolist |
| Version: | 6.x-1.0-beta1 |
| Component: | Code |
| Category: | task |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | closed |
Jump to:
Description
Hi.
To ensure XHTML validity you should use <input type="checkbox" checked="checked" /> (see line 150 of todolist.module).
Much better than writing <input type="checkbox"... would be theme_checkbox()^ or drupal_render()^ to create the checkboxes.
greetings,
Stefan
| Attachment | Size |
|---|---|
| todolist_cleanup.patch | 1.14 KB |

#1
I have a problem with the verbosity of the output of the entire Drupal FAPI system. For example, theme_checkbox() outputs more than just the requisite INPUT element--it adds an unnecessary class="form-checkbox" attribute and then wraps in a DIV element. This is multiplied for every element.
Using this function would also require me to write CSS rule(s) to counteract the block clearing effect of the DIV elements.
Since the module currently outputs valid XHTML as is, will put this off in until I have a FAPI output cleanup solution. This is another module I am planning...
Thanks for your interest and input! :)
#2
Hi.
You're right, theme_checkbox() has a little overhead ;-)
But
<input type="checkbox" checked />isn't valid XHTML (see http://www.w3.org/TR/xhtml1/#h-4.5).greetings,
Stefan
#3
it's done on beta1 :D
#4
Automatically closed -- issue fixed for 2 weeks with no activity.