Yii Framework Forum: Chtml::link To Use Pass Argument Using Chtm::text - Yii Framework Forum

Jump to content

Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

Chtml::link To Use Pass Argument Using Chtm::text Rate Topic: -----

#1 User is offline   jasonban 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 11-May 12

Posted 16 January 2013 - 04:00 AM

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
0

#2 User is offline   BCR 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 36
  • Joined: 12-December 12

Posted 16 January 2013 - 06:18 AM

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.yiiframew...ajaxLink-detail
0

#3 User is offline   jasonban 

  • Junior Member
  • Pip
  • Yii
  • Group: Members
  • Posts: 33
  • Joined: 11-May 12

Posted 17 January 2013 - 03:03 AM

View PostBCR, on 16 January 2013 - 06:18 AM, said:

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.yiiframew...ajaxLink-detail



Thanks for the help..it worked out.
0

Share this topic:


Page 1 of 1
  • You cannot start a new topic
  • You cannot reply to this topic

1 User(s) are reading this topic
0 members, 1 guests, 0 anonymous users