According to the Forms API Reference, all form elements have an #attributes property that can be used to add any applicable html attributes to the form item. Select does not have that currently -- it only has #extra, which simply adds the contents of #extra rather than using the drupal_attributes function. Here is a patch that remedies this problem.
Please review it and apply.
| Comment | File | Size | Author |
|---|---|---|---|
| select_attributes.patch | 1.2 KB | vhmauery |
Comments
Comment #1
tangent commentedA quick look at the docs reveals that the select item should have an attributes field and has no mention of the extras field. Makes sense.
I don't have time to test this patch though.
Comment #2
vhmauery commentedFWIW, I tested it while rewriting the form code for Acidfree. It seemed to work fine for me there.
Comment #3
vhmauery commentedIt looks like this has been fixed, so I guess I will close this.