This week's giveaway is in the Java/Jakarta EE forum.
We're giving away four copies of Java EE 8 High Performance and have Romain Manni-Bucau on-line!
See welcome thread
Win a copy of Java EE 8 High Performance this week in the Java/Jakarta EE forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

content of dropdown B will depend on what is selected on dropdown A  RSS feed

Posts: 1
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hey guys, i want to know how to do this in JSP..

Say I have dropdown A:

<select name = "mySelect">



now depending on what was selected in drodpownA, drodown B will have the following options,

if "A" was selected, values 1, 2, and 3 will be the options
if "B" was selected, values 4, 5, and 6..
and if "C" was selected, values 7,8,9.

Now, these values (1-9) will be loaded from the database. and I just want to have a single page for the two dropdowns, how would that be possible? Could you write me the code?

I know how to pass values and load data from the database by using forms.
<form name = "myForm" method = "post" action= "">
but we all know that the values will be processed by creating a submit button.

With a dropdown menu, how would that be?
Is this possible?
<select name = "mySelect" method = "Post" action = "">
then onChange (when an option is selected in the dropdown, the page will then process the data.

Thanx in advance!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!