Display Colors in Drop Down

Discussion in 'ASP General' started by scott, May 30, 2005.

  1. scott

    scott Guest

    In a regular drop down form element like below, is there a way to display
    associated colors with each option? Basically, I'd like it to look like
    Outlook's Label Control drop down that displays a small color block with
    each choice.

    <select name="sTime"><option selected>--Select Category--
    <OPTION value="WORK">Work Schedule</OPTION>
    <OPTION value="Meeting">Meetings</OPTION>
    <OPTION value="Other">Other</OPTION></select>
    scott, May 30, 2005
    #1
    1. Advertising

  2. scott

    scott Guest

    Works great.


    "Adrienne" <> wrote in message
    news:Xns9666760D39021arbpenyahoocom@207.115.63.158...
    > Gazing into my crystal ball I observed "scott" <>
    > writing in news::
    >
    >> In a regular drop down form element like below, is there a way to
    >> display associated colors with each option? Basically, I'd like it to
    >> look like Outlook's Label Control drop down that displays a small color
    >> block with each choice.
    >>
    >> <select name="sTime"><option selected>--Select Category--
    >> <OPTION value="WORK">Work Schedule</OPTION>
    >> <OPTION value="Meeting">Meetings</OPTION>
    >> <OPTION value="Other">Other</OPTION></select>
    >>
    >>
    >>

    >
    > Sure, just use a little CSS, eg:
    > <option value="Work" style="background-color:yellow; color:green">Work
    > Schedule</option>
    > <option value="Meeting" style="background-color:blue; color:white">
    > Meetings</option>
    >
    > You could also do:
    > <option value="work" class="work">Work Schedule</option>
    > and assign properties for the work class, .work {background-color:yellow;
    > color:green}
    >
    > You might also want to look into the OPTGROUP element, which will group
    > your elements and can also be styled.
    >
    > --
    > Adrienne Boswell
    > http://www.cavalcade-of-coding.info
    > Please respond to the group so others can share
    scott, May 30, 2005
    #2
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. SirPoonga
    Replies:
    2
    Views:
    742
    Ben Strackany
    Jan 7, 2005
  2. weiwei
    Replies:
    0
    Views:
    1,001
    weiwei
    Jan 5, 2007
  3. msimmons
    Replies:
    0
    Views:
    458
    msimmons
    Jul 16, 2009
  4. Replies:
    5
    Views:
    253
  5. Replies:
    3
    Views:
    275
Loading...

Share This Page