473,398 Members | 2,389 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,398 software developers and data experts.

ajax drop down auto populate from database

i have a drop down list tied to a database called location.
what i hope to achieve is once a location is selected, my other drop down list will auto-populate a list of department in that location. how do i go about on connecting the two drop down list together so when location is changed, it connects to the appropriate row in the database?
Oct 13 '10 #1
1 2525
Frinavale
9,735 Expert Mod 8TB
The term for this is Cascading DropDownLists.

What you need to do is handle the SelectedIndex changed of the first DropDownList and populate the second one based on what the user selected.
Oct 14 '10 #2

Sign in to post your reply or Sign up for a free account.

Similar topics

3
by: Russ | last post by:
I have a drop down list on a web page that I pre-fill onload from a SQL table using a SqlDataReader. The line of code that fills the drop down looks like this while(myReader.Read()) {...
1
by: Boris Twila | last post by:
I just want to have 1 drop down list fill the other drop down list without a round trip. Is there some really simple ajax thing i can copy and use, or is it a big deal do i habe to install an...
6
by: Rob Meade | last post by:
Hi all, Looking for a bit of help if possible. For about 2 weeks now I've been investigating the best way to populate related drop down menus, and have their values pre-populated again if the...
0
by: tusaar | last post by:
Hi all I am in big need for a drop down menu created with php, mysql and ajax. Exactly, I need three drop down menu (Category, Subcategory and Item). The data of each drop down will come from...
0
by: jaeden99 | last post by:
I have a two drop down list box. The first contains district name(district id is the value) and the the second will contain the user name based on the district selected in the first drop down list....
0
by: jsd219 | last post by:
Hello, hopefully someone can help me with this: I currently have a php file that pulls a query from the field "category" from my database. this file is called category.php. I am trying to populate...
1
by: wradyn | last post by:
As an example, my MySQL database has 3 tables: main-area, sub-area, and items. Using PHP I populate my first select-list as follows: <?php // Create list containing the Main Areas echo "Select...
5
by: elangobala | last post by:
I need a sample code for the ajax program when i click the country (drop down) i want to get the values for this from the database and setting it in the another drop down nearer to country which...
14
by: adamjblakey | last post by:
Hi, I have a function here: var AdminResponse = ""; function parseResponse(){ var nText = AdminResponse.getElementsByTagName('optionText');
1
selvasoft
by: selvasoft | last post by:
Hi Please any one help me i want list out the values in drop down box. But the values from my database. How can am select that value from my database using JSP.give me example code pleas.
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.