sfWidgetFormSchemaFormatter should not set the label for attribute for radio/checkbox lists because it references an id that does not exist and is not xhtml compliant. Unfortunately I have to render the form field to determine if it is a radio or checkbox list since it doesn't appear that default attributes are accessible in the symfony core library.
Index: lib/widget/sfWidgetFormSchemaFormatter.class.php
===================================================================
--- lib/widget/sfWidgetFormSchemaFormatter.class.php (revision 18891)
+++ lib/widget/sfWidgetFormSchemaFormatter.class.php (working copy)
@@ -170,7 +170,8 @@
return '';
}
- if (!isset($attributes['for']))
+ $fields = $this->widgetSchema->getFields();
+ if (!isset($attributes['for']) && ($fields[$name]->getOption('choices') === null || ($fields[$name]->getOption('choices') === null && substr($fields[$name]->render(), 0, 6) === '<input'))) {
{
$attributes['for'] = $this->widgetSchema->generateId($this->widgetSchema->generateName($name));
}