Quote:
Originally Posted by sherlockturtle
I tried but when i would change to any of the selections it would do the function.
|
Hi,
you can call javascript function on change event of select element as shown below.
<SELECT NAME="selState" SIZE="1" ONCHANGE="HandleChange();">
<OPTION VALUE="IL">Illinois</OPTION>
<OPTION VALUE="MO">Missouri</OPTION>
<OPTION VALUE="HA">Hawaii</OPTION>
<OPTION VALUE="NY">New York</OPTION>
In handleChange() function you can acess the value
function HandleChange() {
// based on the selected value you can perform your action following is
//the line which will get you selected value from the list box.
// you can write case statement for each value.
alert(document.forms.selState.value);
}
http://www.4guysfromrolla.com/webtech/101398-1.shtml