Get the Dynamic row values in yii

Hi I have the following dropdown lists

<td colspan=4>

			&lt;table id=&quot;mytable&quot;&gt;


			&lt;tbody&gt;


				&lt;tr&gt;


			


	&lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;meta,'ScriptArgumentClass_id'); ?&gt;


		&lt;?php


		&#036;criteria = new CDbCriteria;


		&#036;criteria-&gt;order = 'ScriptArgumentClassType'; //or whatever field


		echo CHtml::activeDropDownList(&#036;meta,'[]ScriptArgumentClass_id',CHtml::listData(AutoScriptArgumentClass::model()-&gt;findAll(&#036;criteria),'id','ScriptArgumentClassType'), array('prompt'=&gt;'Please select Argument class type'));


	   	?&gt;	


	   	&lt;/td&gt;


      &lt;td&gt;&lt;?php echo &#036;form-&gt;labelEx(&#036;model,'AutoTnType_id'); ?&gt;


	  	


		&lt;?php


		&#036;criteria = new CDbCriteria;


		&#036;criteria-&gt;order = 'TnType'; //or whatever field


		echo CHtml::activeDropDownList(&#036;meta,'[]Type_id',CHtml::listData(AutoTnType::model()-&gt;findAll(&#036;criteria),'id','TnType'), array('prompt'=&gt;'Please select TN type'));


	   	?&gt;


	   &lt;/td&gt;

Using Jquery I am able to add one more row below every time I click on AddNew link

<?php Yii::app()->clientScript->registerCoreScript(‘jquery’); ?>

<script type="text/javascript">

$(document).ready(function() {

&#036;(&quot;#add&quot;).click(function() { 


	          &#036;('#mytable tr:last').clone(true).insertAfter('#mytable tr:last');   


	                  return false;        


	                   });   


  }); 


  &lt;/script&gt;

<a href="#" id="add">Add New</a>

but I am unable to get all the row values in the controller?????????

Any help is appreciated.

If you are using a debugger, check the POST variable if it contains the added row values. If not, you can simply use var_dump to see all the elements POSTed. If it is not included, probably the added rows are not included as part of the form being submitted.

when I use var_dump after filling 2 dynamic rows I get this

array(8) { [0]=> array(1) { [“ScriptArgumentClass_id”]=> string(1) “5” } [1]=> array(1) { [“Type_id”]=> string(1) “4” } [2]=> array(1) { [“Service_id”]=> string(1) “3” } [3]=> array(1) { [“Cpe_id”]=> string(1) “1” } [4]=> array(1) { [“ScriptArgumentClass_id”]=> string(1) “4” } [5]=> array(1) { [“Type_id”]=> string(1) “2” } [6]=> array(1) { [“Service_id”]=> string(1) “1” } [7]=> array(1) { [“Cpe_id”]=> string(1) “2” } }

How do I save it?

Does the var_dump-ed values that you have there contains the dynamically added rows? If yes, I think you need to create a foreach loop then create an SQL statement to insert the data one row at a time.