Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Conditionally display a graphic in a table

Status
Not open for further replies.

ABinBoston

Programmer
Nov 6, 2001
22
US
I have a list of "tasks" that displays in a table on an ASP page.

I'd like to use 3 small icons, one if the status of the task is "pending", another if the status is "completed" and another is the status is "reassigned". The status is based on a field in the recordset named "taskstatus"

basically, I'd like to say if taskstatus = pending, show pending.gif, elseif taskstatus = complested, show else complested.gif and so on as the table is generated.

I have seen this on some mesageboards, but cannot figure it out.

Thanks!
 
Try a variation of this code to generate the appropriate image tag within your table cell:

<%
select case RECORDSET(&quot;taskstatus&quot;)

case 'pending'
response.write(&quot;<img src='pending.gif'>&quot;)

case 'completed'
response.write(&quot;<img src='completed.gif'>&quot;)

case 'reassigned'
response.write(&quot;<img src='reassigned.gif'>&quot;)

end select
%>

Be sure that RECORDSET reflects the actual name of the RecordSet variable that you've opened the database with.

Good luck,

Ken Kasmar
Red Falcon Internetworking, Inc.

%>
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top