yii - Tabular Input In Create Action -
i have followed tutorial http://www.yiiframework.com/doc/guide/1.1/en/form.table tabular input got stuck.
everything works fine except filling inputs. when fill fields , do
$model->attributes=$_post['racingtable'];
it doesn't pick of entries , when user doesn't fill , suppose show error remove entries inputs.
but when this
$model->attributes=$_post['racingtable'][0];
it takes entries first group of input fields , fill other groups entries.
i'm not talking saving database. i'm talking when user wrong takes him create action , should fill inputs user's entries.
post complete controller/action code can better picture. now, guessing not validating model before trying save. , tabular input array hence not able value doing $_post['racingtable'];
have define index of array too. that's reason when defining index [0] in second line of code it's taking first set of values. should run loop , try values defining index, shown in link provided.
foreach($items $i=>$item) { if(isset($_post['item'][$i]))
if doesn't solve it, post complete action code, it's difficult find out whats wrong posted.
Comments
Post a Comment