Originally posted by Brian Nice:
When you come into the page, you could load some javascript arrays with all the selections for A, and another array to hold the selections for B. Then when the user chooses A or B, use javascript to change the values in the drop down menu.
Or you can refresh the page and send the page on the URL line, the selection of A or B. So when the user changes his selection, refresh the page with a parameter showing which was selected by appending it to the URL line, then get the selection from the request and based on that choose which drop down box you would like to display.
And yes, you can choose the drop down menu items from the database. I use a custom tag to do that, but you could also use a bean to read from the database and use JSP to go through th resultset and build the drop down box, or something similar.
HTH
Brian
Dil se....,<BR>Dayanand<BR>0065-8839071(off)<BR>0065-7547034(Res0
Originally posted by Brian Nice:
in your bean, if you have the values stored in some sort of array or collection, either use a getter method to return your collection item and loop through the collection to form your drop down, or use an indexed getter to get particular items from your collection.
Example:
<% String [] AValues = bean.getValues();
if (Avalues != null) { %>
<select name="dropdown">
<% for (int i=0; i<Avalues.length; i++) {
String val = AValues[i]; %>
<option value="<%=val%>"><%=val%></option>
<% } %>
</select>
<% } %>
HTH
Brian
You can't have everything. Where would you put it?
Smokeless wood heat with a rocket mass heater
https://woodheat.net
|