Forums
This topic is locked
Best way of doing this?
Posted 27 Sep 2002 13:44:18
1
has voted
27 Sep 2002 13:44:18 Dave Thomas posted:
I'm doin a football site, and what i would like to have is a Current Form table (not form used in webstuff but form as in how well they are playing)I've got 3 images - Win, Lose + Draw
In a DB table i'll a have a field populated with a seperate category with the fields - win, lose and draw
Ok, so i want to have a repeat region (horizontal) showing a line of images representing their performance.
Like - WWWDLLDDLLLWWWWDLDDWW but only with images.
I know how to do it for 2 images and a yes/no value but this has boggled me a bit <img src=../images/dmxzone/forum/icon_smile.gif border=0 align=middle>
Cheers chaps
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
Replies
Replied 27 Sep 2002 14:13:53
27 Sep 2002 14:13:53 Vince Baker replied:
Assuming that your recordset is called RSresults:
<%
Dim strResult, strDisplayImage
strResult = RSresults.fields.item("Result_Fields_Name"
.value
%>
<% If strResult = "Win" Then strDisplayImage = "Win.jpg" End IF %>
<% If strResult = "Draw" Then strDisplayImage = "Draw.jpg" End IF %>
<% If strResult = "Lose" Then strDisplayImage = "Lose.jpg" End IF %>
Insert this where you want the image to appear:
<img src="<%=strDisplayImage%>">
and add a repeat region on it. If it is not in a table it will automatically repeat across the page. Then, you can copy and paste the code into the table row (if you want it to reside there)
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
<%
Dim strResult, strDisplayImage
strResult = RSresults.fields.item("Result_Fields_Name"

%>
<% If strResult = "Win" Then strDisplayImage = "Win.jpg" End IF %>
<% If strResult = "Draw" Then strDisplayImage = "Draw.jpg" End IF %>
<% If strResult = "Lose" Then strDisplayImage = "Lose.jpg" End IF %>
Insert this where you want the image to appear:
<img src="<%=strDisplayImage%>">
and add a repeat region on it. If it is not in a table it will automatically repeat across the page. Then, you can copy and paste the code into the table row (if you want it to reside there)
Regards
Vince
Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 27 Sep 2002 18:26:18
27 Sep 2002 18:26:18 Dave Thomas replied:
Is it possible to also, have the same recordest display in a table with a "style" applied depending on the result.
i.e : <% If srtResults = "win" Then Response.Write "<TD BGCOLOR='red'>" End if%>
or something along them lines
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
Edited by - UltraDav on 28 Sep 2002 07:36:53
i.e : <% If srtResults = "win" Then Response.Write "<TD BGCOLOR='red'>" End if%>
or something along them lines
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
Edited by - UltraDav on 28 Sep 2002 07:36:53
Replied 28 Sep 2002 09:42:55
28 Sep 2002 09:42:55 Dave Thomas replied:
Vince the code you supplied works with no errors, only it shows only the WIN graphic.
Should look like : WWLWL
Looks Like : WWWWW
The rs is called rsClanAForm, and heres the code to display the graphics
<%
Dim strResult, strDisplayImage
strResult = rsClanAForm.fields.item("Result"
.value
If strResult = "Win" Then strDisplayImage = "win.gif" End IF
If strResult = "Draw" Then strDisplayImage = "draw.gif" End IF
If strResult = "Lose" Then strDisplayImage = "lose.gif" End IF
%>
any ideas?
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
Should look like : WWLWL
Looks Like : WWWWW
The rs is called rsClanAForm, and heres the code to display the graphics
<%
Dim strResult, strDisplayImage
strResult = rsClanAForm.fields.item("Result"

If strResult = "Win" Then strDisplayImage = "win.gif" End IF
If strResult = "Draw" Then strDisplayImage = "draw.gif" End IF
If strResult = "Lose" Then strDisplayImage = "lose.gif" End IF
%>
any ideas?
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
Replied 30 Sep 2002 09:30:16
30 Sep 2002 09:30:16 Vince Baker replied:
Is the code with the if statements inside the repeat region?
If it is above it, then you will only get wwww.
Regards
Vince
Response.write("The best line of code you can ever use"
VBScript | ASP | HTML | SQL | Oracle | Hosting
If it is above it, then you will only get wwww.
Regards
Vince
Response.write("The best line of code you can ever use"

VBScript | ASP | HTML | SQL | Oracle | Hosting
Replied 30 Sep 2002 11:41:55
30 Sep 2002 11:41:55 Dave Thomas replied:
ah i see, will try it out.
I got the images to work ok, i had to redesign the DB , and put an IMGresult field in the main table and just filtered the records from that, worked a lot easier but made the DB much bigger, would much rather have it working the way you showed me.
I'll let you know how it goes..
page is @ www.nova-cs.co.uk/version2/clan_results.asp if u wanna have a look.
Regards,
Dave
UD4 || Flash || Access ||Web Hosting
I got the images to work ok, i had to redesign the DB , and put an IMGresult field in the main table and just filtered the records from that, worked a lot easier but made the DB much bigger, would much rather have it working the way you showed me.
I'll let you know how it goes..
page is @ www.nova-cs.co.uk/version2/clan_results.asp if u wanna have a look.
Regards,
Dave
UD4 || Flash || Access ||Web Hosting