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
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

AttachmentSize
todolist_cleanup.patch1.14 KB

#1

mikesmullin - October 28, 2007 - 23:09
Status:active» postponed

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

stBorchert - November 1, 2007 - 11:49

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

marvil07 - October 8, 2009 - 20:05
Title:small code cleanup» checkbox XHTML validity
Version:5.x-1.x-dev» 6.x-1.0-beta1
Status:postponed» fixed

it's done on beta1 :D

#4

System Message - October 22, 2009 - 20:10
Status:fixed» closed

Automatically closed -- issue fixed for 2 weeks with no activity.

 
 

Drupal is a registered trademark of Dries Buytaert.