Foreach Textfield With Multiple Row Insert At Once

Hi guyz i have a foreach, within the loop has a two field to be insert. How to insert each every loop in every row… heres my code




<?php

echo CHtml::beginForm(); 


foreach($model as $model){


	<td>

	<?php

		//caption				

			echo CHtml::hiddenField('imgDir',"/images/uploads/".$model);

			echo CHtml::textArea('imgDir','',array('style'=>'height:100px;width:300px;'));

			

?>

 </td>

 </tr>

 

<?php		

 }

 ?>

 <tr><td>

 <?php

 echo  CHtml::submitButton("Save",array('confirm'=>'Are you sure you want to save changes?','class'=>'btn btn-primary'));

 ?>

 </td>



Hi,

I am not sure what you are asking… but if you want to link foreach loop with textfield you should do like this

foreach($models as $i=>$model) {

<?php echo $form->textField($model,"[".$i."]textfield_name",array(‘style’=>‘margin-left:-3px’)); ?>

}