I need to implement a form like the attached file,
each time I click add button, 1 row will be inserted , the row includes: 1 dropdownlist for inventory category,number of people from/to, and 1 dropdownlist for inventory item,
What I want is : when i choose the first dropdownlist( inventory category in the first column) , the second one will be updated according to its value( in the last column).
public function actionSelectInventory(){
$data=array(0=>'aaa',1=>'bbb',2=>'ccc');
foreach($data as $value=>$name)
{
echo CHtml::tag('option',
array('value'=>$value),CHtml::encode($name),true);
}
}
ajax works well( ajax is called from controller), but it seems that it can not find the right place to update. I try to viewsource the page in HTML, but can not find selector for that. (add function works well, )