hi. i’m trying to have an image change to match with the id of the selected option. What i’d like it to eventually do is when i click the button ‘back’, it’ll take the value and subtract one from it and change the photo to go with the new id and vise-versa with ‘next’. can anybody help me??
this is my code so far
[code=php]
<html>
<head>
<title>test</title>
</head>
<body><center>
<p><image name=’pic1′></p>
<input type=”button” value=”Back” onClick=”fun();”>
<select name=’name’ onChange=”change(selectedIndex);”>
<option id=’next’ value=1>next</option>
<option id=’back’ value=2>back</option>
</select>
<input type=”button” value=”Next” onClick=”fun();”>
<script languange=”javascript”>
function fun()
{
alert(“hi”);
}
function change(selectedIndex)
{
document.images[‘pic1’].src =name.options[selectedIndex].id + ‘.jpg’;
window.status=name.options[selectedIndex].id;
}
</script>
</center></body>
</html>