views:

324

answers:

4

Hi guys. I don't know the name for this, if did i would search for it.

I wanted something like this, i think its uses javascript but I'm not sure how to do it know.

In a web page you have 2 listboxs, its content comes from mysql.

There is 2 tables in the database, for each listbox, they are both related.

Then when you select a item from the listbox 1 we dynamically loads the options for listbox 2 based on the selection you made in listbox1, and if you change the selection it listbox 1 he also changes the options for listbox 2.

I think i've expressed correctly, if its confused just say it.

Thanks for the help once again.

+1  A: 

http://www.onlinetools.org/articles/accessibleinter/ is a good article on this subject. It doesn't go into how you would generate the HTML, but it should be pretty easy to do that in your server side programming language of choice.

David Dorward
thats exactly what i wanted :D
Fábio Antunes
+1  A: 

http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/ is a jquery plugin using PHP and mySQL

Josh

Josh
Thanks for the link it.Its very helpfull because it helps with my question, and gives a lot of other tips for jQuery, which I'm trying to use now.
Fábio Antunes
+1  A: 

Sounds like you are looking for some combination of Ajax + Server side language + MySQL.

Ajax can be handled with: - jQuery - Mootools - Home brew XmlHttpResponse

Server side can be: - C# - Java - PHP - Ruby

Using JavaScript to attach to the onChange event of the first list box, you would then use ajax to get the second listbox contents (based on the selected item in the first list)

Bryan Migliorisi
i preferred jQuery.. onChange ?.. i was trying onClickthanks.
Fábio Antunes
+1  A: 

It can be done using AJAX.

You need to make a server side call from Javascrpit. And return XML response from Server side call.

Cheers

Ratnesh Maurya
http request method.. yes :Dthanks
Fábio Antunes