I have a drop down list "ddSelectState" that I'm filling from access database. Using VBscript (I know, evil word here)
Anyway "Front Page" made a javascript routine MM_jumpMenu that redirects to a page directly after it's picked from the dropdown list. In this case I'm gong to the same page no matter which state they choose. But I want to get the value from the drop down list and pass it to the next page preferably by session variable which is the "StateChosen" on the next page.
here is the code I have.
DougP
< I Built one
Anyway "Front Page" made a javascript routine MM_jumpMenu that redirects to a page directly after it's picked from the dropdown list. In this case I'm gong to the same page no matter which state they choose. But I want to get the value from the drop down list and pass it to the next page preferably by session variable which is the "StateChosen" on the next page.
here is the code I have.
Code:
<script type="text/JavaScript">
<!--
function MM_jumpMenu(targ,selObj,restore){ //v3.0
//session["StateChosen"] =selObj.text [COLOR=red] I tried adding it here but then it does not redirect to next page[/color]
eval(targ+".location='"+selObj.options[selObj.selectedIndex].value+"'");
if (restore) selObj.selectedIndex=0;
}
//-->
</script>
<%'get states from db
State=request.querystring("State")
response.write State
rtnCompany =Session("company")
Set fp_conn = Server.CreateObject("ADODB.Connection")
fp_conn.Open Application("IHDatabase_ConnectionString")
Set fp_rs_Facility = Server.CreateObject("ADODB.Recordset")
Set fp_rs_Analyte = Server.CreateObject("ADODB.Recordset")
SQLStringFacility = "SELECT Company, FacilityState FROM IndustrialHygiene GROUP BY Company,FacilityState HAVING Company = '" & rtnCompany & "';"
fp_rs_Facility.Open SQLStringFacility, fp_conn, 1, 3, 1
fp_rs_Facility.movefirst
'response.write SQLStringFacility
%>
<form name=form1>
<p class=MsoNormal align=center><span
style='font-family:"Times New Roman","serif";color:windowtext'>
<SELECT NAME="ddSelectState" onChange="MM_jumpMenu('parent',this,0)" size="1">
<option value="Choose State" selected>Choose State</option>
<%do while not fp_rs_Facility.EOF%>
<OPTION VALUE="../ihexcel.asp"><%=fp_rs_Facility("FacilityState")%></option>
<%fp_rs_Facility.movenext%>
<%loop%>
</SELECT></span></p>
</p>
</select>
</form>
DougP
< I Built one