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.

CommentFileSizeAuthor
#1 formselectcss.patch1.82 KBbudda

Comments

budda’s picture

StatusFileSize
new1.82 KB

Patch 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.

Thox’s picture

-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.

killes@www.drop.org’s picture

Status: Needs review » Closed (won't fix)

I don't think this is too usefull either. Maybe the form functions should be made themable?

budda’s picture

+1 for themable form elements idea!