Hi, i want to know how to extract values from drop down box for processing in next field. In my file first drop down has list of countries taken from a database. I want to show location of that particular country in the other dropdown. The list of all locations is also in the same database. My code is as follows.
<html><body><form name="frm" method="post" action="update.jsp">
<b>COUNTRY:</b> </td>
<select name="coun" style="width: 246px" onChange ="this.frm2.submit();" ><option value="">Select</option>
<%
sql = dbconn.prepareStatement("select * from T500L order by LTEXT ");
results = sql.executeQuery();
while(results.next()){
String name = results.getString(2);
String id = results.getString(1);
%><option value="<%= name %>">
<% out.println(name); %>
</option>
<%} results.close(); sql.close(); %>
</select>
<b>LOCATION:</b> </td>
<select name="loc" style="width: 246px"><option value="">Select</option></select>
</form>
</body>
</html>
could anyone please give me a solution.