Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 4 of 4
  1. #1
    New Coder
    Join Date
    Jan 2003
    Location
    N. Ireland
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts

    how do you display image with test string?

    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
    ska

  • #2
    New Coder
    Join Date
    Jan 2003
    Location
    Peterborough, UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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.

  • #3
    New Coder
    Join Date
    Jan 2003
    Location
    N. Ireland
    Posts
    79
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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..
    ska

  • #4
    New Coder
    Join Date
    Jan 2003
    Location
    Peterborough, UK
    Posts
    39
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A pleasure Ska.


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •