I need to show two dependent drop-down lists in my page. If we select an item from first drop-down list, based on the item which we selected, it should filter the entries in the second drop-down list, then I need to perform a search using the value in the second drop-down list. But the thing is that the values come from the table to show in the first drop-down list is not an active record of it. Can anyone help on this?
Currently I have that second drop-down list in place and it can perform a search based on the selected value. Now what I need to do is place a drop-down list above this and filter the items based on the first drop-down list.
Edit
1st table – client_id, client_name – items in the first drop-down list should show client names
2nd table – program_id, client_id, program_name –
3rd table – ad_id, program_id, ad_name – the second drop-down list should show ad_names filtered by using client_id.
Finally I did that, here is it.
In my controller,
and in my view, I have added