Jump to content

List box - update another list box following single or multiple selections


cerebros

Recommended Posts

Hi everyone,

 

I'm a bit new to Ajax and have been trying to find an example online of something similar to learn from without much joy.

 

Basically I've got a form with 3 list boxes (using <select>). The first list box is for countries, the second is for counties/states, and the third is for towns/cities.

 

What I want to happen is that when the page loads initially the list box for countries is populated from MySQL using straight PHP, which I've done.

 

When the user selects a country I then want the counties/states list box to update with the counties and states for that country. This I should be able to manage from the little I've learnt so far with Ajax.

 

However, when it comes to populating the towns/cities list, I want the user to be able to select multiple counties/states and have the towns & cities within those states/counties populate that list.

 

Can anyone point me towards a good example of something similar?

 

thanks

 

 

 

Link to comment
Share on other sites

  • 1 month later...

Hi, ignace gave this link to me: http://remysharp.com/2007/09/18/auto-populate-multiple-select-boxes/  its for a neat jQuery plugin that will make you able to do what you wanted with the select element, one of the guys on that page commented and said that it also worked for a multi-selection, jQuery looks easy enough even though I'm a noob at it LOL... Merry christmas and a happy new year to you, and strongs with the project.

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.