Hello,
I'm using 2 DB READ to populate 2 simple dropdown from two different tables.
Dropdown1 gets its data from model M1(Table Tbl1)
Dropdown2 gets its data from model M2(Table Tbl2)
Both table contain the field COLOR.
The data is displayed on the form with no problem.So far so good
What I need to do :
When I select something in Dropdown1, Dropdown2 needs to get populated only with the corresponding values.
For example if i select RED in Dropdown1, Dropdown2 should show me records which have RED as COLOR.
Can someone guide on achieving this please?
I need this :
1. Get selected value in Dropdown1
2. Populate Dropdown2 with list of values WHERE field = selected value in Dropdown1
I have tried using a condition in Dropdown2, but its not working. I think its because it is in the ON LOAD block..I dunno..
I'm getting Notice: Undefined index: M1
I'm using 2 DB READ to populate 2 simple dropdown from two different tables.
Dropdown1 gets its data from model M1(Table Tbl1)
Dropdown2 gets its data from model M2(Table Tbl2)
Both table contain the field COLOR.
The data is displayed on the form with no problem.So far so good
What I need to do :
When I select something in Dropdown1, Dropdown2 needs to get populated only with the corresponding values.
For example if i select RED in Dropdown1, Dropdown2 should show me records which have RED as COLOR.
Can someone guide on achieving this please?
I need this :
1. Get selected value in Dropdown1
2. Populate Dropdown2 with list of values WHERE field = selected value in Dropdown1
I have tried using a condition in Dropdown2, but its not working. I think its because it is in the ON LOAD block..I dunno..
<?php
return array('M2.COLORS' => $form->data['M1']['COLORS']);
?>
<?php
return array('M2.COLORS' => $form->data['Dropdown1']['']);
?>
I'm getting Notice: Undefined index: M1
This topic is locked and no more replies can be posted.