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

Popular posts from this blog

java.util.scanner - How to read and add only numbers to array from a text file -

rewrite - Trouble with Wordpress multiple custom querystrings -