Forums

ASP

This topic is locked

Change font color if it meets criteria

Posted 07 Nov 2002 18:45:53
1
has voted
07 Nov 2002 18:45:53 Sharon Burkey posted:
Using the following to show a red None allocated - but would also want it to have a blue font if the allocated person is for instance "Joe Bloggs" - going round in circles - any advice would be much appreciated:


<% if rs_resp_estore.Fields.Item("FirstName".Value <> "" then Response.Write rs_resp_estore.Fields.Item("FirstName".Value & "&nbsp" & rs_resp_estore.Fields.Item("LastName".Value else response.write "<font color=red>None allocated</Font>" end if %>

Replies

Replied 07 Nov 2002 22:06:25
07 Nov 2002 22:06:25 Owen Eastwick replied:
<% if rs_resp_estore.Fields.Item("FirstName".Value <> "" then %>
<font color=blue><%= rs_resp_estore.Fields.Item("FirstName".Value & " " & rs_resp_estore.Fields.Item("LastName".Value %></Font>
<% else %>
<font color=red>None allocated</Font>
<% end if %>

Regards

Owen.

Multiple Parameter UD4 / Access 2000 Database Search Tutorial:
www.tdsf.co.uk/tdsfdemo
Replied 08 Nov 2002 03:58:45
08 Nov 2002 03:58:45 Dave Blohm replied:
I had a similar situation recently, but the scenario called for a variety of colors, not just two...heres roughly how i did it:

<%
varName = rs_resp_estore.Fields.Item("FirstName".Value

Select Case varName
Case "Bill"
varColor = "#000000"
Case "Stan"
varColor = "#003366"
Case "Orion"
varColor = "#FF6600"
Case ""
varColor = "#FF0000"
Case Else
varColor ="#666666"
End Select
%>
<font color=<%=varColor%>><%=varName%></font>



Hope this helps...

Doc
Rangewalk Digital Studios

Reply to this topic