I have a JavaScript that changes the output on the same page by using:
<"a href="#" onclick="change('Bob','0','0','2','2','1','0','0')">Bob</a>
<"a href="#" onclick="change('Sam','0','0','2','2','1','0','0')">Sam</a>
<"a href="#" onclick="change('Ted','0','0','2','2','1','0','0')">Ted</a>
I would like to change the links to a dropdown (select – option) form field.
Any help putting me in the right direction will be appreciated.
Using
this.valuegives you the currently selected option of the select box (Bob, Sam or Ted).EDIT
If you want to pass different parameters to your function, you can do it like this:
Javascript:
HTML:
So you pass your selected value to
selectValueChanged, and this function calls thechangefunction with the appropriate paremeters.