Sbml
Sbml

Reputation: 1927

Filtering the dropdown options

I need to update automatically several Drop-downs filtering the options from database for the next Dropdown. I'm using in my website jquery, javascript, ajax, php.

Its very common in websites with driver downloads, for example:

Acer

Samsung

Thanks in advance

Update:

I'm using this code snippet: http://www.pedrocorreia.net/mySnippets/php/Actualizar-DropDownList-Utilizando-Ajax ,but I have some problems to adapt the code for more than 2 dropboxes.

I'm looking for any example, tutorial or plugin.

Upvotes: 1

Views: 745

Answers (3)

Fender
Fender

Reputation: 3055

look here for a codesnippet using html, jquery and php

http://codeassembly.com/Simple-chained-combobox-plugin-for-jQuery/

Upvotes: 1

hungryMind
hungryMind

Reputation: 6999

Use ajax to get ddl2 data on selection change of ddl1. Use jquery for ajax call, option add and event handling.

Upvotes: 1

Fender
Fender

Reputation: 3055

after the user selected a value from the first dropdown you send the selected value to a php script (ajax!) and generate the valid dropdownoptions for your next dropdown. then you insert the values recieved from the server with jquery.

you should disable all dropdowns, which are not meant to be used because there was no selection in a previous dropdown yet.

Upvotes: 1

Related Questions