This topic is locked

colouring a text from a dropdown box

5/30/2008 6:02:07 AM
PHPRunner General questions
S
shoppy author

In a field I have an optionbox (lookup table).

On of the options has to stand out in the list of my clients.
Is it possible that one option in this optionbox gets a different colour?
I was a bit playing aroud in the 'Where' option but .......... pfffftttt I can't do this.
please help a pour guy.
John

J
Jane 5/30/2008

John,
edit BuildSelectControl funciton in the generated include/commonfunctions.php file for this purpose.

For example find this line:

echo '<option value="'.htmlspecialchars($data[0]).'">'.htmlspecialchars($data[1]).'</option>';



and replace it with this one:

if ($data[1]=="your value")

echo '<option style="color:red;" value="'.htmlspecialchars($data[0]).'">'.htmlspecialchars($data[1]).'</option>';

else

echo '<option value="'.htmlspecialchars($data[0]).'">'.htmlspecialchars($data[1]).'</option>';

S
shoppy author 5/31/2008

John,

edit BuildSelectControl funciton in the generated include/commonfunctions.php file for this purpose.

For example find this line:
and replace it with this one:


Thanks Jane,
It is red in the dropdownbox but I ment it had to turn red in the list.


You see in the list at the right end of the screen 'Status'.

There you see the stautus of the policies. For example 'Active' (Aktief) but also 'Ended' (Geroyeerd).
Expecialy the ended ones I want to be in red. Because those need action!
I hope you can help me.
John

J
Jane 6/2/2008

John,
I see what you're saying.

Use Custom format on the "View as" settings dialog for this purpose.

Here is a sample:

if ($value=="Geroyeerd")

$value = "<font color=red>".$value."</font>";

S
shoppy author 6/2/2008

Perfect !!!
It works.
Very much thanks Jane for youre help.

Youre great.
(Sometimes I am just not very clear in what I mean. Thanks to the English)
regard,
John