Loading data in a combobox from a db with local filtering

JavaScript and client side scripting.

Moderator: General Moderators

Post Reply
vinaynahata
Forum Newbie
Posts: 1
Joined: Tue Sep 15, 2009 11:38 pm

Loading data in a combobox from a db with local filtering

Post by vinaynahata »

Hi ,

I want to populate a combobox with data pulled from a mysql db . The value of second combobox depends on what's been selected in first combobox. I assume pulling the data completely when loading the combobox and then filtering it locally to populate the second combobox based on the selection in first combobox will suit my needs so that i do not have to query server.What is the best way of doing it?Any free javascript library which can make my job easier?Further any sample code snippet would be appreciated as i am a newbee in javascript/php.
User avatar
CoderGoblin
DevNet Resident
Posts: 1425
Joined: Tue Mar 16, 2004 10:03 am
Location: Aachen, Germany

Re: Loading data in a combobox from a db with local filtering

Post by CoderGoblin »

Dynamic/Chained Selects using Ajax Prototype/JQuery gives one example although not sure how up-to-date it is. The phrase you need to look for via your favourite search engine is Dynamic or Chained Selects.
Post Reply