This topic is locked

background color

3/16/2009 11:14:52 AM
ASPRunnerPro General questions
C
cookie_monster author

Hello
I have the example of how to change background color based on data
[codebox]str = "<table width=100% bgcolor="

if strValue= "OPEN" then

str = str & "red"

else

str = str & "blue"

end if

str = str & "><tr><td>" & strValue & "</td></tr></table>"

strValue = str[/codebox]
but I need to change the color based on more than one value, so if the strValue is ` 1 ` then red , if the value is ` 2` then blue and if the value is ` 3 ` then yellow.
any help much appreciated,
Regards ,
jason

J
Jane 3/16/2009

Jason,
please see my changes below:

str = "<table width=100% bgcolor="

if strValue= 1 then

str = str & "red"

elseif strValue= 2 then

str = str & "blue"

elseif strValue= 3 then

str = str & "yellow"

end if

str = str & "><tr><td>" & strValue & "</td></tr></table>"

strValue = str

C
cookie_monster author 3/16/2009

Thank you very much.
jason