I have the following code that creates a combo box and retrieves the values for that combo box from another table in the database.
<!--CREATE TEXT BOX SO USER CAN EDIT APPROP FUNDING TYPE-->
<td align="center">
<%
'RETRIEVE ALL RECORDS IN THE AGENCY TABLE
Cmd="SELECT FundingType FROM Tbl_Funding_Type ORDER BY FundingType"
'EXECUTE THE SQL COMMAND
SET RsFundingCombo=AAR400PRPdb.execute(Cmd)
%>
<select name="ComboFundingType" onChange="onChange()">
<%
DO WHILE NOT RsFundingCombo.eof
%>
<option value="<%=RsFundingCombo.Fields("FundingType")%>" name="<%Trim(RsFundingCombo.Fields("FundingType"))%>"><%=Trim(RsFundingCombo.Fields("FundingType"))%>
<%
RsFundingCombo.movenext
LOOP
%>
</select></td>
The next section of code is the java script i use to store the value the user chose -
<!--THIS SECTION IS TO STORE THE VALUE CHOSEN FROM THE DROP DOWN MENU-->
<script language="JavaScript"><!--
function onChange() {
var Current = document.appropriationform.ComboFundingType.selectedIndex;
document.appropriationform.currentText3.value = document.appropriationform.ComboFundingType.options[Current].text;
}//--></script>
<!--THIS IS THE END OF THE SECTION OF THE VALUE CHOSEN FROM THE DROP DOWN MENU-->
The problem is that I want the value chosen from the drop down menu to be stored in a variable, not a text box on the form like it has in the code. I have tried substittuting the "document.appropriationform.currentText3.value" with a variable name "ex- lvTest" but it does not work. any suggestions? I asm not that familiar with JAVA.
THANKS!
<!--CREATE TEXT BOX SO USER CAN EDIT APPROP FUNDING TYPE-->
<td align="center">
<%
'RETRIEVE ALL RECORDS IN THE AGENCY TABLE
Cmd="SELECT FundingType FROM Tbl_Funding_Type ORDER BY FundingType"
'EXECUTE THE SQL COMMAND
SET RsFundingCombo=AAR400PRPdb.execute(Cmd)
%>
<select name="ComboFundingType" onChange="onChange()">
<%
DO WHILE NOT RsFundingCombo.eof
%>
<option value="<%=RsFundingCombo.Fields("FundingType")%>" name="<%Trim(RsFundingCombo.Fields("FundingType"))%>"><%=Trim(RsFundingCombo.Fields("FundingType"))%>
<%
RsFundingCombo.movenext
LOOP
%>
</select></td>
The next section of code is the java script i use to store the value the user chose -
<!--THIS SECTION IS TO STORE THE VALUE CHOSEN FROM THE DROP DOWN MENU-->
<script language="JavaScript"><!--
function onChange() {
var Current = document.appropriationform.ComboFundingType.selectedIndex;
document.appropriationform.currentText3.value = document.appropriationform.ComboFundingType.options[Current].text;
}//--></script>
<!--THIS IS THE END OF THE SECTION OF THE VALUE CHOSEN FROM THE DROP DOWN MENU-->
The problem is that I want the value chosen from the drop down menu to be stored in a variable, not a text box on the form like it has in the code. I have tried substittuting the "document.appropriationform.currentText3.value" with a variable name "ex- lvTest" but it does not work. any suggestions? I asm not that familiar with JAVA.
THANKS!