...

View Full Version : how do you display image with test string?



skalag
02-25-2003, 10:14 PM
i want to display an image with a text string, i have retrieved the option value in 'strchoice' and determined which image has been selected in 'select case strchoice' , i now want to display it alongside 'Request("strtext")' ,at present the selected image appears at the page top but i want to add it on like
.....& Request("strtext") & imagesourcefordisplay & "
I have tried dozens of ways to pass the image source into this string but cannot get it to work...its just the same as in a message board dispalying an icon....

code
---------------------------------------------------------------
Dim strchoice
strChoice = CInt(Request.Form("pic"))


IF Request.Form("allow") = "TRUE" THEN
file = file & "<B><FONT SIZE=2 FACE='Arial>" & user & "(" & Now & ") : </FONT></B>" & Request("strtext") & "<br>"


SELECT CASE strchoice
Case "1"

%><IMG src="images/pic1.gif" width="25" height="25"><%

Case "2"
%><IMG src="images/pic2.gif" width="15" height="15"><%

case else
END SELECT
END IF

raven
02-26-2003, 12:15 AM
You've taken a rather long route around this. The SELECT statement is unnecessary. Try this:

Dim strchoice
strChoice = CInt(Request.Form("pic"))


IF Request.Form("allow") = "TRUE" THEN

file = file & "<B><FONT SIZE=2 FACE='Arial>" & user & "(" & Now & ") : </FONT></B>" & Request("strtext") & "<br><img src=images/pic" & strChoice & ".gif width=25 height=25>"

End if


Then use <%response.write file%> to display the contents of the string on the page.

skalag
02-26-2003, 12:30 AM
it works a treat raven, i tried fitting the strchoice variable in everywhere like that except in the the place where it was required before the .gif....its obvious now you have pointed it out, thanks very much for the help..

raven
02-26-2003, 12:35 AM
A pleasure Ska.



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum