You should also be able to have a function 'per item selected' using the selectedIndex method. So you'd have a function called by the onchange event, then depending on the selection made, another function being called.
ie:
<form name ="form1">
<select name ="sel1" onchange ="myFunction()">
<option value ="0">0
<option value ="1">1
<option value ="2">2
</option>
</select>
<script language ="javascript">
function myfunction(){
var theSelection = document.form1.sel1.selectedIndex
if (theSelection ==0){
function0()
}
elseif (theSelection ==1){
function1()
}
elseif (theSelection ==2){
function2()
}
}
function0(){
alert("I was called from function 0")
}
function1(){
alert("I was called from function 1")
}
function2(){
alert("I was called from function 2")
}
</script>
Hope that helps! (Haven't tested yet, but it looks ok)
interrupt
|