3 Drop Down Lists On Same Page Linked The The Same Model

Hi,

I need to have three drop down lists on a page ,linked to the same model

List 1 - Populated by ‘name’ field from model

List 2 - Populated by ‘name’ field from model minus the selection from List 1

List 3 - Populated by ‘name’ field from model minus the selection from List 1 and selection from List 2

thanks in advance

You need to use Ajax.

this is the good sample about your question:

http://www.yiiframework.com/wiki/429/an-easy-solution-for-dependent-dropdownlist-using-ajax/

  • City name will displayed after Region chosen.

thanks

I already checked that tutorial , but my issue is when it come to third dropdown, How do I pass both List 1 & List 2 values when generating 3rd dropdown?

you can send paremeter:




 'data'=>array(

'dropdown_1'=>'js:this.value',

'dropdown_2'=>'js:$("#cbo2").val()'

),



Thanks, this worked.