Hello,
I've been reading Tek-Tips for several days and still can't figure out how to pass a html <select> box selected value to a <input> text box about 10 lines below on the same page. The <select> box is populated from a sql db on page load and after user selection the value is successfully placed in a JS variable (function):
<script language="JavaScript">
function dropdw_text()
{
var w = document.assign.alocdesc.selectedIndex;
var selected_loc = document.assign.alocdesc.options[w].text;
alert(selected_loc);
}
</script>
<select onChange="dropdw_text()" name="alocdesc" id="alocdesc">........</select>
The alert works fine. I just need to get the value of selected_loc into an ASP <%Session("location")%> object and I can't. Can anyone point me in the right direction?
Thanks,
Riley
I've been reading Tek-Tips for several days and still can't figure out how to pass a html <select> box selected value to a <input> text box about 10 lines below on the same page. The <select> box is populated from a sql db on page load and after user selection the value is successfully placed in a JS variable (function):
<script language="JavaScript">
function dropdw_text()
{
var w = document.assign.alocdesc.selectedIndex;
var selected_loc = document.assign.alocdesc.options[w].text;
alert(selected_loc);
}
</script>
<select onChange="dropdw_text()" name="alocdesc" id="alocdesc">........</select>
The alert works fine. I just need to get the value of selected_loc into an ASP <%Session("location")%> object and I can't. Can anyone point me in the right direction?
Thanks,
Riley