hello 
i'm new here, i hope someone will find a way to help me
quickly: i need a script that allows me to change an image and the link associated to it through a dropdown menu
i was able to change the image but not the link
this is the code
PHP Code:
<?php
$path // path
$url // each image has a link to a page (with the same ID of the image)
$totimg // size of arrays
$stationID // array of values
$stationNM // array of option names
echo "<a href='$url/$stationID[0].html' target='_blank'>";
echo "<img src='$path/$stationID[0].gif></a>";
?>
<SCRIPT LANGUAGE="JavaScript1.2">
function uSlct (ImgID, position)
{
document.locality.weatherID.options.selectedIndex = position;
replaceImage(ImgID);
// chbutton(document.locality.weatherID);
}
function replaceImage(ImgID)
{
document.weatherImg.src = '<? echo"$path"; ?>'+ImgID+'.gif';
}
</SCRIPT>
<FORM NAME="locality" METHOD="POST" >
<SELECT NAME="weatherID" onchange="replaceImage(document.locality.weatherID.options[document.locality.weatherID.selectedIndex].value);">
<?
for ($i=0; $i<$totimg; $i++){
echo "<option value=\"$stationID[$i]\">$stationNM[$i]</option> ";
}
?>
</SELECT>
</FORM>
thnx a lot in advance 
|