• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

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

 
Greenhorn
Posts: 1
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • 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">

<option>A</option>
<option>B</option>
<option>C</option>

</select>

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= "display.do">
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 = "Something.do">
then onChange (when an option is selected in the dropdown, the page will then process the data.

Thanx in advance!
 
Sheriff
Posts: 13411
Firefox Browser VI Editor Redhat
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
I have an example of this here:
http://simple.souther.us/not-so-simple.html
 
reply
    Bookmark Topic Watch Topic
  • New Topic