File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
The moose likes JSP and the fly likes Drop Down Menu Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » JSP
Bookmark "Drop Down Menu" Watch "Drop Down Menu" New topic

Drop Down Menu

Barun Saha

Joined: Nov 10, 2003
Posts: 24
I have a drop down list which is populated from a table (Ex Customer Code)
I would like to display the customer name next to the selected Code.
Customer Code Customer Name
Pull Down Menu Should display selected Name for Customer.
[ February 03, 2004: Message edited by: zimby zany ]
Bear Bibeault
Author and ninkuma

Joined: Jan 10, 2002
Posts: 63865

"zimby", you have been asked before to change your display name to conform to Ranch standards (in this very forum). This is not optional. Please change your display name prior to your next post. Further defiance of the policy may result in the deletion of your account.
JSP Forum Bartender
[ February 03, 2004: Message edited by: Bear Bibeault ]

[Asking smart questions] [About Bear] [Books by Bear]
Barun Saha

Joined: Nov 10, 2003
Posts: 24
Profile update done. Now can someone please help me.
Frank Carver

Joined: Jan 07, 1999
Posts: 6920
Thanks for changing your displayed name. We really do appreciate it.
I guess what you are asking for is how to use the SELECT and OPTION tags in HTML to display one thing, but send another:
To do this you need to generate something like the following from your JSP

The "value" of the selected option will be sent to the server, and the text between the <option> tags will be shown to the user.
Has that helped?
[ February 05, 2004: Message edited by: Frank Carver ]

Read about me at ~ Raspberry Alpha Omega ~ Frank's Punchbarrel Blog
I agree. Here's the link:
subject: Drop Down Menu
It's not a secret anymore!