File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Application Frameworks and the fly likes how to populate dropdown box dynamically Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of EJB 3 in Action this week in the EJB and other Java EE Technologies forum!
JavaRanch » Java Forums » Frameworks » Other Application Frameworks
Bookmark "how to populate dropdown box dynamically" Watch "how to populate dropdown box dynamically" New topic
Author

how to populate dropdown box dynamically

sruthi das
Ranch Hand

Joined: Dec 28, 2007
Posts: 34
hi
can any one help me how to populate dropdown box dynamically.
i have two dropdownboxes.based on the value which i select in first dropdown the corresponding values in second drop down box has to come.
i have to get both dropdown values from database.
Paras Jain
Ranch Hand

Joined: Feb 26, 2005
Posts: 137
Obviously you will have to capture the onChange event of the first drop down.
Depending on the value of this drop down you will send the request to the server and populate the value in the second drop down. You can send the request asynchronously using Ajax etc or through simply form submit using Javascript.
You can use JQuery or plain Javascript to capture onChange events etc


Paras Jain
SCJP 5.0
Bear Bibeault
Author and ninkuma
Marshal

Joined: Jan 10, 2002
Posts: 60045
    
  65

Which framework are you using?


[Asking smart questions] [Bear's FrontMan] [About Bear] [Books by Bear]
sruthi das
Ranch Hand

Joined: Dec 28, 2007
Posts: 34
I am using spring framework.
I want it by using javascript.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to populate dropdown box dynamically
 
Similar Threads
dropdown from database
JSON Object and Java Script DropDown
Dropdown values
how to populate drop down list using servlet and jsp
How to create a h:selectOneMenu with a default value?