dependent dynamic dropdown list from database jsp

Posted by Cpatil1000 under JavaScript on 6/2/2016 | Points: 10 | Views : 252 | Status : [Member] | Replies : 1

I am trying dropdown list in jsp. first i am trying
bind dropdown list with district and then Taluka. When I select
district then automatically bind a taluka drop down list.
So how to do this, kindly make change in following. so
i can understand where is my mistake.

Connection conn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=GATEWAY", "sa", "allied007");
Statement stmt = conn.createStatement();
ResultSet rs = stmt.executeQuery("Select ID, DISTRICT From District_Master");

Connection Talconn = DriverManager.getConnection("jdbc:sqlserver://localhost:1433;databaseName=GATEWAY", "sa", "allied007");
Statement Talstmt = Talconn.createStatement();
ResultSet Talrs = Talstmt.executeQuery("Select id, District_id, Taluka From Taluka_Master");

<select id="ddlStateName" name="ddlStateName" class="columnwidth1">
<option value="0" selected>Select</option>
<% while ( {%>
<option value="<%=rs.getString("ID")%>"><%=rs.getString("DISTRICT")%></option>
<% }%>

<select name="ddlTalukaName" class="columnwidth1">
<option value="0">Select</option>
while ( {%>
<option value="<%=Talrs.getString("ID")%>"><%=Talrs.getString("Taluka")%></option>


Posted by: Bhuvanesh6 on: 7/26/2016 [Member] Starter | Points: 25


Login to post response