This week's giveaway is in the Programmer Certification (OCPJP) forum.
We're giving away four copies of Java Mock Exams (software) and have David Mayer on-line!
See this thread for details.
Win a copy of Java Mock Exams (software) this week in the Programmer Certification (OCPJP) forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic

how to populate dropdown box dynamically

 
sruthi das
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 140
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
Bear Bibeault
Author and ninkuma
Marshal
Posts: 65658
129
IntelliJ IDE Java jQuery Mac Mac OS X
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Which framework are you using?
 
sruthi das
Ranch Hand
Posts: 34
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I am using spring framework.
I want it by using javascript.
 
What are you doing? You are supposed to be reading this tiny ad!
the new thread boost feature brings a LOT of attention to your favorite threads
https://coderanch.com/t/674455/Thread-Boost-feature
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!