i'd like to CSS my select menu list. However the drupal common.inc form_select() doesn't assign each with a unique id/class.
the option list id's could be generated in the form:
<select-name>-<option value>
Which could produce something like:
<select class="card" name="edit[card]" id="edit-card">
<option value="" selected="selected">Please Choose</option>
<option value="VISA" id="card-visa">Visa</option>
<option value="MC" id="card-mc">Mastercard</option>
<option value="SWITCH" id="card-switch">Switch</option>
<option value="SOLO" id="card-solo">Solo</option>
</select>
The above would then allow individual styling to each - in my case displaying an image next to each option.
Comments
Comment #1
buddaPatch for above CSS modification request.
Most of what can currently be done with CSS on elements is only useful on Mozilla browsers. IE can't do anything exciting, it just ignores the content.
Comment #2
Thox commented-1
That's a lot of extra markup for every
<select>control. Since it has very limited use, I'd suggest it shouldn't be part of core.I do like the idea of using it for your specific case.
Comment #3
killes@www.drop.org commentedI don't think this is too usefull either. Maybe the form functions should be made themable?
Comment #4
budda+1 for themable form elements idea!