aspose file tools*
The moose likes JSP and the fly likes JSP code to select a drop down item Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Java » JSP
Bookmark "JSP code to select a drop down item" Watch "JSP code to select a drop down item" New topic
Author

JSP code to select a drop down item

DOLLY REDDY
Greenhorn

Joined: Feb 08, 2005
Posts: 7
HI FRIENDS
I HAVE A JSP CODE WITH A DROP DOWN LIST.i NEED A JSP PROGRAM WHERE IF I SELECT A DROPDOWN LIST ITEM I SHOULD BE ABLE TO DISPLAY CORRESPONDING VALUES IN ANOTHER DROP DOWN LIST
[ February 14, 2005: Message edited by: Bear Bibeault ]
ramprasad madathil
Ranch Hand

Joined: Jan 24, 2005
Posts: 489

You will have to bring the data into the jsp as a map, and then
1. have a select field
2. loop thru the map keys and for each key add an option to the select field.
3. have an onChange() js event for the select field which will pick up the current key set in the select field, get its corresponding value from the map and set this value in another select field.

ram.
Ben Souther
Sheriff

Joined: Dec 11, 2004
Posts: 13410

Dolly, welcome.

Typing in all uppercase letters is considered screaming.
A lot of people won't help someone who screams at them.

There was acually a pretty long conversation about doing just this, yesterday.
See if this thread answers your question.
http://www.coderanch.com/t/359818/Servlets/java/Passing-parameters-jsp-servlet

If not, give us some more information about what you are trying to do.
Where are the values coming from, a database, hardcoded,...?
Does this have to be server side or could it be done on the client with Javascript?


Java API J2EE API Servlet Spec JSP Spec How to ask a question... Simple Servlet Examples jsonf
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: JSP code to select a drop down item