P
pukeko.taniwha
Hi, i am trying to get a function to work, but i am still learning
javascript and i really need some help.
i have a select form
<select ="menu1" onChange="onMapClick(menu1.value)">
<option selected>Select Dataset</option>
<option value="massey_07">Turitea 2007</
option>
<option value="Massey_02_2003">Turitea
2003</option>
<option value="All_orthos">Turitea</
option>
<option value="albany2005">Albany 2005</option>
<option value="albany2004">Albany 2004</option>
<option value="albanycom">Albany</option>
</select>
and i want to make the value from this form into a variable and pass
it to this function as "imageSRC"
<script language="javascript">
// User clicked a new region. Parameter is name of that region.
function onMapClick(){
menu1.value = imageSRC;
document.ECWView1.DeleteAllLayers();
document.ECWView1.AddLayer("ECW", "ecwp://" + document.location.host +
"/Massey/images/Massey/" + imageSRC + ".ecw", "RasterLayer",
"freecache=TRUE");
}
</script>
i have tried lots of different things, but i firefox's firebug console
tells me that -
menu1 is not defined
onchange(change )
what am i doing wrong?
sorry, this is probably really basic.
Matt
javascript and i really need some help.
i have a select form
<select ="menu1" onChange="onMapClick(menu1.value)">
<option selected>Select Dataset</option>
<option value="massey_07">Turitea 2007</
option>
<option value="Massey_02_2003">Turitea
2003</option>
<option value="All_orthos">Turitea</
option>
<option value="albany2005">Albany 2005</option>
<option value="albany2004">Albany 2004</option>
<option value="albanycom">Albany</option>
</select>
and i want to make the value from this form into a variable and pass
it to this function as "imageSRC"
<script language="javascript">
// User clicked a new region. Parameter is name of that region.
function onMapClick(){
menu1.value = imageSRC;
document.ECWView1.DeleteAllLayers();
document.ECWView1.AddLayer("ECW", "ecwp://" + document.location.host +
"/Massey/images/Massey/" + imageSRC + ".ecw", "RasterLayer",
"freecache=TRUE");
}
</script>
i have tried lots of different things, but i firefox's firebug console
tells me that -
menu1 is not defined
onchange(change )
what am i doing wrong?
sorry, this is probably really basic.
Matt