Hi,
I have a drop down menu which is populated from the database. What I want to do now is take whatever value the user selects from the drop down, assign it to a variable and use this to retrieve values from the database. I'm new to java and am unsure of the syntax.
Great if anyone can help!
The code so far is as follows for the drop down:
<% Vector v = (Vector)session.getAttribute("stocks"
Stock s; %>
<table border = 1 bordercolor = "green" width = "100%" align = "center">
<tr>
<td><b>Symbol</b></td>
</tr>
<tr>
<%
for(int i =0; i< v.size(); i++)
{
s =(Stock)v.elementAt(i);
String symbol = s.getStockSymbol();
%>
<td>
<select><option><%=symbol%></option></select>
</td>
</tr>
<%
}//end for loop
%>
</table>
I have a drop down menu which is populated from the database. What I want to do now is take whatever value the user selects from the drop down, assign it to a variable and use this to retrieve values from the database. I'm new to java and am unsure of the syntax.
Great if anyone can help!
The code so far is as follows for the drop down:
<% Vector v = (Vector)session.getAttribute("stocks"
Stock s; %>
<table border = 1 bordercolor = "green" width = "100%" align = "center">
<tr>
<td><b>Symbol</b></td>
</tr>
<tr>
<%
for(int i =0; i< v.size(); i++)
{
s =(Stock)v.elementAt(i);
String symbol = s.getStockSymbol();
%>
<td>
<select><option><%=symbol%></option></select>
</td>
</tr>
<%
}//end for loop
%>
</table>