I want to change the dropdown values when changing the radio button and defaultly I want to check one radio button and show corresponding values
My code is here:
<td>
<input type="radio" name="status" style="width:1em;height:1em;margin:0.8em 0 0 0" value="false" id="idPdf" />
<label style="width:4em">Parcel</label></td>
<input type="radio" name="status" style="width:1em;height:1em;margin:0.8em 0 0 0" value="true" id="idPdf" checked="checked"/>
<label style="width:4em">Table</label></td>
<td> <input type="radio" name="status" style="width:1em;height:1em;margin:0.8em 0 0 0" value="false" id="idExcel"/>
<label style="width:4em">Parcel</label></td></tr>
<tr style="background-color: #ebf4fb;">
<td><label style="width:7em">Table Num:</label></td>
<td> <select name="txtTableNum" id="idSelectTable" style="width: 150px; height: 25px;" >
<option style="font-weight: bold; color:#000000; width: 100px; height: 25px; ">Select</option>
<%
try {
DBConnection dbConn = new DBConnection();
conn1 = dbConn.getConnection();
st1 = conn1.createStatement();
rs1 = st1.executeQuery("select distinct(order_table_no) from order_master where bill_no='0' and order_table_no like 'Table%' ");
while (rs1.next()) {
%>
<option style="font-weight: bold; color:#000000; width: 100px; height: 25px; " ><%=rs1.getString(1)%></option>
<%
}
rs5=st1.executeQuery("select distinct(order_table_no) from order_master where bill_no='0' and order_table_no like 'Parcel%' ");
while (rs5.next()) {
%>
<option style="font-weight: bold; color:#000000; width: 100px; height: 25px; "><%=rs5.getString(1)%></option>
<%
}
} catch (Exception e) {
}
%>
own values
Here you can see two options having two result set with values coming from database, I want the first option as Default dropdown value and first radio button as checked , if i click second radio button i want to change the drop d