The attributes argument of form_checkboxes() and form_radios() is currently used to apply the same attributes to each input tag. In some cases you might want to have different attributes applied to each checkbox or radio button. For example, this makes disabling some of the checkboxes possible.

An example of the usage is

array('somekey' => array('disabled' => 'disabled'), 'someotherkey' => (...), ...)

This patch also removes the br tag after each checkbox and radio button. Drupal.css is used to set the display to block. br is a presentational tag which often conflicts with using CSS to style things.

CommentFileSizeAuthor
#1 common.inc_6.diff3.32 KBdrumm

Comments

drumm’s picture

StatusFileSize
new3.32 KB

Forgot the patch.

And I forgot to mention that the $attributes argument is not used anywhere in Drupal core so this does not affect other code.

drumm’s picture

Status: Needs review » Postponed

I'm going to let this wait until after the new form api is in place.

forngren’s picture

Status: Postponed » Fixed

Fixed with FAPI

Anonymous’s picture

Status: Fixed » Closed (fixed)