change colour of background in DRW

M

Mick

Hi, I have the following code in my DRW
<%
If FP_FieldVal(fp_rs,"SortedDate") = FP_FieldVal(fp_rs,"journeydatetotf") then
dtdepartarrive = "Arrival"
else
dtdepartarrive = "Departure"
end if
%>
then the field <%=dtdepartarrive%>appears at the end of each record.

What I would like to do so colour the background and text colour differently
for "arrival" and "departure" results.
Any help would be appreciated, thank you.
 
S

Stefan B Rusynko

Add the font color to your VBscript variables as a span style
- Note the use of double quotes inside of the quoted variables
<%
If FP_FieldVal(fp_rs,"SortedDate") = FP_FieldVal(fp_rs,"journeydatetotf") then
dtdepartarrive = "<span style=""background-color:yellow; color:red;"">Arrival</span>"
else
dtdepartarrive = "<span style=""background-color:white; color:green;"">Departure</span>"
end if
%>


--

_____________________________________________
SBR @ ENJOY (-: [ Microsoft MVP - FrontPage ]
"Warning - Using the F1 Key will not break anything!" (-;
_____________________________________________


| Hi, I have the following code in my DRW
| <%
| If FP_FieldVal(fp_rs,"SortedDate") = FP_FieldVal(fp_rs,"journeydatetotf") then
| dtdepartarrive = "Arrival"
| else
| dtdepartarrive = "Departure"
| end if
| %>
| then the field <%=dtdepartarrive%>appears at the end of each record.
|
| What I would like to do so colour the background and text colour differently
| for "arrival" and "departure" results.
| Any help would be appreciated, thank you.
 
M

Mick

Hi Stefan, thank you so much (again!) absolutely spot on, and worked first
time, thanks Mick
 

Ask a Question

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

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top