I have a form that create with CActiveForm Widget.with jquery i create textbox in this widget form but when i submit the form these fields does not send.what should i do?
$form=$this->beginWidget('CActiveForm', array(
'id'=>'event-form',
'enableAjaxValidation'=>false,
'htmlOptions' => array('enctype' => 'multipart/form-data'),
));
echo $form->textField($model,'title',array('size'=>45,'maxlength'=>45));
// missing php tag?>
<input type="text" name="lname"/>
<?php // missing php tag
$this->endWidget();
// missing php tag
?>
suppose you have a class named Post and an attribute title,
then you need to make input like this
<input type="text" name="Post[title]"/>
or
echo CHtml::textField('Post[title]' , '');
see we have attribute inside post array, that is what yii is looking for attributes