Forum Moderators: coopster

Message Too Old, No Replies

Show multiple select based on the selection of another multiple selec

Show multiple select based on the selection of another multiple select

         

phparion

8:08 pm on Nov 24, 2009 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member Top Contributors Of The Month



Hi guys,

I am making a feature where user can see a multiple select list from which he can select one or more languages. As there can be more than one dialects of each language so I want to make a feature where user can select a Language name and its dialects are automatically displayed in another multiple select list. If user selects more than one multiple list then it show more than one multiple selects of dialects for each language selected.

for this I have two tables, one for languages and second for each language dialects. language table PK is used in the dialects table as FK to attach them withe each other.

I am confused about the ajax part. I googled around but did not find anything useful for this issue, please add your wise words.

Thank you!

coopster

3:02 pm on Dec 5, 2009 (gmt 0)

WebmasterWorld Administrator 10+ Year Member



There are a number of ways to approach this but one would be to build both select lists if they are somewhat small/manageable and push them back to the browser. Keep the second select list hidden (using CSS display:none) until an onchange event handler occurs on the first select list and then only show it if the first selection required a dialect selection.