Chtml::link To Use Pass Argument Using Chtm::text

Dear Yii friends… I have the form similar to this:-

<?php echo CHtml::beginForm(’’, ‘post’, array(‘name’ => ‘addsubsection’)); ?>

<?php echo "<br/>" ?>

<?php // echo CHtml::link(“ADD Description”, array(‘tabledata/adddescription’)); ?>

<?php echo CHtml::textField(‘subsection’); ?>

<?php echo "<br/>" ?>

<?php echo CHtml::link(“ADD Subsection”, array(‘tabledata/secondsubsection’)); ?>

<?php echo "<br/>" ?>

<?php echo CHtml::button(‘Save Subsection’,array(‘submit’ => array(‘tabledata/savesubsection’, ‘sec_id’=>$section_id,‘sec_num’=>$section_number))) ?>

<?php echo CHtml::endForm(); ?>

Where I have a text field named by subsection…and when I click the link…ADD Subsection…than i want to pass the value in secondsubsection method…I was wondering if anyone have idea how to get it in controller…

Thanks in Regards

Sundar

You could use CHtml::ajaxLink to pass the data to the controller method. Select and pass the value of your textField in the ‘data’ of ajaxOptions.

Refer to: http://www.yiiframework.com/doc/api/1.1/CHtml#ajaxLink-detail

Thanks for the help…it worked out.