Hello, I have two drop-down menus. As I select the option form first menu, i query from db according to the option. And the recordset are second menu's option values. I use submit() method to reload the page and change the second menu. Is there any other way to do? Thank you.
Yes, When the page loads the first time you can have all of theoptions written out in arrays and use a premade javascript double combo script to fill in the second drop down. THis would not require the form to be submitted to get the options and will be faster for the user in most cases. Eric
It depends This is a jsp example: <% String[] values = myClass.getValuesFromDB(); %> <script> var jsArray = new Array(); <% for(int i=0;values!=null && i<values.length;i++){%> //this line assumes you can not get '\n' or double quotes from db //if so you have to escape them. jsArray[<%=i%>]= "<%=values[i]%>"; <%}%> </script>
Mo-om! You're embarassing me! Can you just read a tiny ad like a normal person?