[CN]ZooL
09-01-2001, 20:44
damn forums are totally messed up.. so heres what my first attempt should have said ;)
ok, dont know much javascript, so its a fair bet ive done something wrong or missed something huge from meh script ;)
but, heres what i have a problem with: (hope this makes sense)
1 image that id like to swap via choosing options on 2 seperate selects/lists. along lines of something like choice1 gives 'groupA' and choice2 gives 'week1' , then adding '.gif' to end to give src of the swapped image - groupAweek1.gif
(script i wrote is below) BUT. it doesnt work like i would have hoped. the principle works, in that the image is changed, but changed to an 'undefined' image, also, when loading the page in ie55 get the 'done, but errors' msg
<html>
<head>
<title>Untitled Document</title>
<script>
<!--
var where = "screenshots/"
var ImgNameGroup = document.theForm.groupChoice.value
var ImgNameWeek = document.theForm.weekChoice.value
var ImgType = ".gif"
function showScreenshot()
{
document.screenshotImg.src = where + ImgNameGroup + ImgNameWeek + ImgType
}
// -->
</script>
</head>
<body bgcolor="#000000" text="#999999">
<img src="screenshotImg.gif" name="screenshotImg">
<form name="theForm">
<table width="300" border="0" cellspacing="0" cellpadding="1">
<tr>
<td align="center" width="200">
<select name="groupChoice">
<option value="groupA" selected>Group A</option>
<option value="groupB">Group B</option>
<option value="groupC">Group C</option>
<option value="groupD">Group D</option>
<option value="groupE">Group E</option>
<option value="groupF">Group F</option>
<option value="groupG">Group G</option>
<option value="groupH">Group H</option>
</select>
</td>
<td align="center" width="200">
<select name="weekChoice" multiple onChange="showScreenshot()">
<option value="week1">Week 1</option>
<option value="week2">Week 2</option>
<option value="week3">Week 3</option>
<option value="week4">Week 4</option>
<option value="week5">Week 5</option>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>
ok, dont know much javascript, so its a fair bet ive done something wrong or missed something huge from meh script ;)
but, heres what i have a problem with: (hope this makes sense)
1 image that id like to swap via choosing options on 2 seperate selects/lists. along lines of something like choice1 gives 'groupA' and choice2 gives 'week1' , then adding '.gif' to end to give src of the swapped image - groupAweek1.gif
(script i wrote is below) BUT. it doesnt work like i would have hoped. the principle works, in that the image is changed, but changed to an 'undefined' image, also, when loading the page in ie55 get the 'done, but errors' msg
<html>
<head>
<title>Untitled Document</title>
<script>
<!--
var where = "screenshots/"
var ImgNameGroup = document.theForm.groupChoice.value
var ImgNameWeek = document.theForm.weekChoice.value
var ImgType = ".gif"
function showScreenshot()
{
document.screenshotImg.src = where + ImgNameGroup + ImgNameWeek + ImgType
}
// -->
</script>
</head>
<body bgcolor="#000000" text="#999999">
<img src="screenshotImg.gif" name="screenshotImg">
<form name="theForm">
<table width="300" border="0" cellspacing="0" cellpadding="1">
<tr>
<td align="center" width="200">
<select name="groupChoice">
<option value="groupA" selected>Group A</option>
<option value="groupB">Group B</option>
<option value="groupC">Group C</option>
<option value="groupD">Group D</option>
<option value="groupE">Group E</option>
<option value="groupF">Group F</option>
<option value="groupG">Group G</option>
<option value="groupH">Group H</option>
</select>
</td>
<td align="center" width="200">
<select name="weekChoice" multiple onChange="showScreenshot()">
<option value="week1">Week 1</option>
<option value="week2">Week 2</option>
<option value="week3">Week 3</option>
<option value="week4">Week 4</option>
<option value="week5">Week 5</option>
</select>
</td>
</tr>
</table>
</form>
</body>
</html>