Results 1 to 7 of 7

Thread: [completly Resolved] javascript: change Picture OnClick argh.

Threaded View

  1. #1

    Thread Starter
    Fanatic Member JPicasso's Avatar
    Join Date
    Aug 2001
    Location
    Kalamazoo, MI
    Posts
    843

    [completly Resolved] javascript: change Picture OnClick argh.

    Okay. Why the heck won't this work for me.

    It works somewhat, but not 100%.

    What I want is an image to change based on a drop-down value.
    However, I'd be happy to just get it working for some hard-coded pictures.

    Here's what I got as a test page, I plan on populating the drop down from a database later.
    If you can supply some hints for using the value of the drop down, I'd appreciate that also.
    (this will be an ASP page)
    VB Code:
    1. <script language="JavaScript">
    2. function DoPic()
    3. {
    4.   document.PutPicHere.src="Charts\0.jpg";
    5. }
    6. </script>
    7.  
    8. <html>
    9. <body>
    10.  
    11. Hello, why don't your web page work? loser.
    12. <table>
    13. <tr>
    14.   <td><font face="arial">Choose One
    15.  
    16.     <select name="MyPix" size=1 onClick="DoPic()">
    17.       <option value="0" selected>Choice Won</option>
    18.       <option value="1" >Choice Too</option>
    19.     </select>
    20.   </td>
    21.   <td>
    22.      <img name="PutPicHere" src="Charts\1.jpg">
    23.   </td>
    24. </tr>
    25. </table>
    26.  
    27. </body>
    28. </html>


    It gets as far as replacing my current 1.jpg with a nice red 'X',
    so it's at least getting that far....

    Yes, there is a dir called Charts,
    Yes, there is a pic called 0.jpg in that dir.
    I'm running on Personal web server, but that shouldn't matter.
    I think I"m following examples I've seen for other questions...
    Last edited by JPicasso; Sep 10th, 2003 at 10:32 AM.
    Merry Christmas

Posting Permissions

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



Click Here to Expand Forum to Full Width