Win a copy of TDD for a Shopping Website LiveProject this week in the Testing forum!
  • 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
  • Paul Clapham
  • Ron McLeod
  • Jeanne Boyarsky
  • Tim Cooke
Sheriffs:
  • Liutauras Vilda
  • paul wheaton
  • Henry Wong
Saloon Keepers:
  • Tim Moores
  • Tim Holloway
  • Stephan van Hulst
  • Carey Brown
  • Frits Walraven
Bartenders:
  • Piet Souris
  • Himai Minh

Populating DropDown in javascript

 
Greenhorn
Posts: 18
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Hello,
I have two dropdown in a jsp page in which values have already been populated using the controler servlet of application. Now when the user selects some value in 1st dropdown, based on this selection I need to populate the values of 2nd dropdown at runtime. What should I do for this as I need to query to the DB with the value selected in 1st dropdown to fetch values of 2nd dropdown. Can I do it in jsp if yes please tell how can it be dome.

Thanks
Kaustubh
 
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
This is one of our most asked questions.

If you have to get the values for the second list from the database then you'll need to do at least part of this on the server. Search this and the HTML/Javascript forum (this is commonly done with AJAX these days) and you will find many threads that discuss this.
[ September 06, 2007: Message edited by: Ben Souther ]
 
Aaaaaand ... we're on the march. Stylin. Get with it tiny ad.
Free, earth friendly heat - from the CodeRanch trailboss
https://www.kickstarter.com/projects/paulwheaton/free-heat
reply
    Bookmark Topic Watch Topic
  • New Topic