|
-
Sep 9th, 2003, 10:41 AM
#1
Thread Starter
Fanatic Member
[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:
<script language="JavaScript">
function DoPic()
{
document.PutPicHere.src="Charts\0.jpg";
}
</script>
<html>
<body>
Hello, why don't your web page work? loser.
<table>
<tr>
<td><font face="arial">Choose One
<select name="MyPix" size=1 onClick="DoPic()">
<option value="0" selected>Choice Won</option>
<option value="1" >Choice Too</option>
</select>
</td>
<td>
<img name="PutPicHere" src="Charts\1.jpg">
</td>
</tr>
</table>
</body>
</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
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|