I have this JavaScript for a dropdown menu, but I don't know how to take the selected value from it.
<select name="slist" >
<script language="javascript">
var states = new Array("Afghanistan", "Albania", "Algeria", "Andorra", "Angola", "Antarctica");
for (var hi = 0; hi < states.length; hi++)
document.write("<option value=\"" + states[hi] + "\">" + states[hi] + "</option>");
document.getSelection(states);
</script>
</select>
I've tried using this command:
document.getElementById("Label1").InnerHTML = states;
but it did not work. How to create a function that would give me the selected value in a label.text?
p.s. the dropdown menu is taken from www.hscripts.com
I forgot to mention that I have this menu in an update panel because I need a flicker free post back. when I click on my submit button the menu loses it's content, why?