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"
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
Comment #1
jhodgdonMarked #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.
Comment #2
jhodgdonYou 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
Comment #3
jhodgdonThis has now been fixed -- Commits: http://drupal.org/cvs?commit=229770 and http://drupal.org/cvs?commit=229768