From http://api.drupal.org/api/file/developer/topics/forms_api_reference.html...

"Note: if you use markup, if your content is not wrapped in tags (generally

or

), your content will fall outside of collapsed fieldsets."
and:
"Properties: #attributes, #prefix (default: ''), #suffix (default: ''), #type. #value, #weight"

If the content doesn't get wrapped, then there's nothing for attributes to apply to, surely?
The following code does nothing with the class, for example:

  $form['image'] = array(
    '#prefix' => '<div>',
    '#value' => '<p>hello</p>',
    '#suffix' => '</div>',
    '#attributes' => array('class' => 'attribute-class'),   
    );

Comments

jhodgdon’s picture

Version: 6.x-dev » 7.x-dev

Marked #495202: FAPI documentation 'markup' shouldn't have '#attributes' as a duplicate of this issue.

Also, as it is still an issue in D7, it should be patched there and then ported to D6.

jhodgdon’s picture

You are correct about attributes. I'll be fixing this shortly, in conjunction with a host of other inconsistencies and mistakes in the FAPI doc. See
#500120: Form API doc has multiple inconsistencies

jhodgdon’s picture

Status: Active » Fixed

Status: Fixed » Closed (fixed)

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