This is a forum where members new and old can come to ask questions and get info and opinions. It is not a place to advertise your business or have other forms of advertising, whether it be in your posts or signature.

All links in the forum will not be indexed by Search Engines and any unapproved forms of advertising or spam will be dealt with accordingly, deleted, and that member's account banned.

Forums

Overview » PHP » Anyone, Anyone, Bueller, Bueller ...
Reply

Anyone, Anyone, Bueller, Bueller ...

Mark Taylor
Member



Since: 06 Feb 2003
Posts: 24
Posted 27 May 2010 13:19:35

Can anyone provide code snippets for cascading dropdowns (2 off) so that when item e.g. Fruit is selected in the first dropdown, the items e.g. Bananas, Apples appear in the second dropdown without the page refreshing. I'd be eternally greatful as i've been stuck on this for weeks, Thanks Mark

Can anyone provide code snippets for cascading dropdowns (2 off) so that when item e.g. Fruit is selected in the first dropdown, the items e.g. Bananas, Apples appear in the second dropdown without the page refreshing. I'd be eternally greatful as i've been stuck on this for weeks, Thanks Mark
Alan C
Total freaking Member



Since: 04 May 2006
Posts: 473
Replied 28 May 2010 12:39:40
You need a javascript that is triggered when the first dropdown changes; when triggered it uses the changed value to access a database and populate the second dropdown.

If you're going to get into this kind of coding check out jquery, it will make you life a lot easier but the learning of it might make your head spin at first []

Here's an example

A great place for help is stackoverflow too

and don't forget that google is your friend

Reply to this topic

Message
Reply
Follow us on Facebook Follow us on twitter Subscribe to the RSS feed
Activate your free membership today | Login | Currency