Exit
  • Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
0

different coloured drop down list....

Participant ,
Apr 27, 2006 Apr 27, 2006

Copy link to clipboard

Copied

hi there all,

I have a drop down list which is dynamic, it brings up a long list of staff.
Is there a way that I can make the background on the list, a different colour depending on the job of staff.

So for example on the list, it would all be white BG, but if there is say a manager the bg behind that name would be blue..?

is that possible or am I being way toooo optimistic...?

many thanks
TOPICS
Server side applications

Views

222
Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Apr 27, 2006 Apr 27, 2006

Copy link to clipboard

Copied

LATEST
On 27 Apr 2006 in macromedia.dreamweaver.appdev, Simonbullen wrote:

> I have a drop down list which is dynamic, it brings up a long list
> of staff. Is there a way that I can make the background on the list,
> a different colour depending on the job of staff.
>
> So for example on the list, it would all be white BG, but if there
> is say a manager the bg behind that name would be blue..?

<option>s will take a background color, thus:

<select name="menu2">
<option value="0" style="background-color:#ccf;">Home</option>
<option value="1" style="background-color:#cfc;">Products List</option>
<option value="2" style="background-color:#fcc;">Tutorials list</option>
<option value="3">Extensions list</option>
<option value="4">Support</option>
</select>

What you're doing is, I assume, something like this (pseudocode):

<select name="menu2">
<& start repeat &>
<option value="<& print value &>"><& print name &></option>
<& end repeat &>
</select>

What you would do:

<select name="menu2">
<& start repeat &>
<option value="<& print value &>" style="<& print stylename &>"><& print name &></option>
<& end repeat &>
</select>

This would involve adding a stylename to every record, or if you
already have something you could use as a stylename, like a job
description, adding that to the <option> as a class.

Optionally, you could do something like:

<option value="<& print value &>" <& if class='manager' print 'style="manager"' &>><& print name &></option>

--
Joe Makowiec
http://makowiec.net/
Email: http://makowiec.net/email.php

Votes

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines