Dynamic HTML for IMG SOURCE

Ask a Question related to Macromedia Dynamic HTML, Design and Development.

  1. #1

    Default Dynamic HTML for IMG SOURCE

    DWMX. Hi, I have a recordset with a ProductID field and i am trying to
    insert this ProductID into the name if the Source image so it becomes dynamic -
    but I am failing miserably ..

    This does not work:

    <td><img src="Pix/tn_"<%=rsOneProduct.Fields.Item("ProductID")%>".jp g"
    width="150" height="200"></td>

    This works:

    <td><img src="Pix/tn_CDR12345.jpg" width="150" height="200"></td>

    Any help appreciated. Thanks. Dave(UK):confused;

    Dave(UK) Guest

  2. Similar Questions and Discussions

    1. No html source for datagrid
      I posted this earlier but this time I am adding a url if you want to see the datagrid. (Use start date of 11/10/2004). Basically I wanted to know...
    2. open source of a html file
      I got my other question wrong. I wrote a script that opens a file and filters out email addresses and urls etc. is there a way to enter a url so...
    3. How to source an html-page (containing vars)
      Hi, I have a CGI-script that needs to print an html-page containing variables dependent on the choise you make. Right now I do this using : ...
    4. get html source of an URL
      Hie, I am trying to write a program doing the following : - I give it an URL (for instance http://www.yahoo.com) - it gets the source of the web...
    5. How to grab HTML source?
      "Mike Darrett" <mike-nospam@darrettenterprises.com> schrieb im Newsbeitrag news:d945119c.0305021419.3f461b9f@posting.google.com... hey mike -...
  3. #2

    Default Re: Dynamic HTML for IMG SOURCE

    Probably all those double-quotes causing syntax errors. You need to concatenate
    the image source name.

    Try adding this between the TD tag and the IMG tag:

    <%x = "Pix/tn_" & rsOneProduct.Fields.Item("ProductID") & ".jpg"%>

    Then change the vbscript inside the SRC attribute to:

    <%=x%>

    delaneypub Guest

  4. #3

    Default Re: Dynamic HTML for IMG SOURCE

    Hi, yes you were spot on , the "" were causing confusion cos they need not have
    been there as part of the concatenation ... this was what I got to work...
    thanks .. Dave

    <td><img src="Pix/tn_<%=rsOneProduct.Fields.Item("ProductID")%>.jpg"
    width="150" height="200"></td>

    Dave(UK) Guest

Posting Permissions

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

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139