Send Variabel From Textfield To Another Page

need help, please…

I have a form and send the variabel from suratTugas1.php to coba1.php. but I can`t get the $_POST variable. the code are

suratTugas1.php


 <?php echo $model->id; ?>

<?php echo CHtml::textField('Text'); ?>

    

    <?php echo CHtml::button('submit',array('submit' => array('coba1', 'id'=>$model->id,'Text'=>$_POST['Text']))); ?>

</body>

</html>

in controller


function actionSuratTugas1($id){

    $this->render('suratTugas1', array(

'model'=>$this->loadModel($id)));


}


function actionCoba1($id){


    $this->renderPartial('coba1',array(

'model'=>$this->loadModel($id),'no'=>$_POST['Text']));


}

You need to wrap your text field and submit button in a <form> tag.

Hi,

you have to change two things…


 




<?php $form=$this->beginWidget('CActiveForm', array(

	'id'=>'form',

)); 


<?php echo $model->id; ?>

<?php echo $form->textField($model,'Text'); ?> // you should have text field in database also

    

    <?php echo CHtml::button('submit',array('submit' => array('coba1', 'id'=>$model->id))); ?>


<?php $this->endWidget(); ?>




I am sure you will get text in your post content :)

cheers