It's a web app with some html, unfortunately I'm new to javascript and I hear thats the way to go with this problem.
here's what I got:
-
-
<%
-
Vector theStates = WeatherDAO.getWeatherStates();
-
%>
-
-
label for="weatherStat">State:</label>
-
-
<select name="weatherStat" id="States">
-
<% for (int i=0; i< theStates.size(); i++) { %>
-
-
<OPTION VALUE=<%=theStates%>> <%=theStates.elementAt(i)%> </OPTION>
-
-
<%
-
}
-
%>
-
</select>
-
-
<label for="weatherCity">City:</label>
-
<select name="weatherCity" id="Cities">
-
-
-
<%
-
Vector theCities = WeatherDAO.getWeatherCities(WeatherStat);
-
%>
-
-
<% for (int i=0; i< theCities.size(); i++) { %>
-
-
<OPTION VALUE=<%=theCities%>> <%=theCities.elementAt(i)%> </OPTION>
-
-
<%
-
}
-
%>
-
-
-
</TD></TR>
-
</center>
-
<TR><TD>
-
<br>
-
<br>
-
<center>
-
-
-
-
-
-
-
</select></TD></TR>
-
</TABLE>
-
nothing populates in the second drop-down
1.) Vector is old. Use ArrayList
2.) If the cities are coming from a database as well then you probably may have to do it using Ajax or else you load all cities and states into arrays and then play around with those arrays. Either way it's a web problem so I'll move this to the Javascript forum.
P.S This problem appears so often that if you do a search on it you'll find a solution in the Javascript forum