Win a copy of Java Concurrency Live Lessons this week in the Threads forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

problem withcombo oxes  RSS feed

 
swati ksn
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi
I have to display 2 combo boxes , each holding data from 2 diff. Access tables.
Initially 1st combobox is filled with data from table1. User selects an option from it.
DEPENDING ON HIS SELECTION I have to fill 2nd cpmbobox with data from table2.
How to achieve this using JSP?(I m using JSP,JavaBeans,Javascript,HTML,JDBC).
-Thanks.
 
Brian Glodde
Ranch Hand
Posts: 171
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
One solution is to load the data for the 2nd select box into a client-side JavaScript array. When the user clicks on the 1st select box, use the "onclick" event to populate the 2nd select list. You'll need to have a look at the "Option" object in JavaScript if you're not familiar.
Here are a few URLs that might help illustrate:
Select List Rewriting
Using JavaScript to Modify Select Lists
Dynamic Select Lists
You'll need to understand the concept of writing a client side array with server side variables as well.
var val1 = '<%=serverSideVariable%>';
 
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!