this is my form that created by CActiveForm
<div class="form">
<?php $form=$this->beginWidget('CActiveForm', array(
'id'=>'Comment',
'enableAjaxValidation'=>true,
)); ?>
<!-- chap error validation -->
<?php echo CHtml::errorSummary($commentForm); ?>
<div class="row">
<?php echo $form->labelEx($commentForm,'name'); ?> :
<?php echo $form->textField($commentForm,'name');?>
<?php echo $form->error($commentForm,'name');?>
</div>
<div class="row">
<?php echo $form->labelEx($commentForm,'email'); ?> :
<?php echo $form->textField($commentForm,'email');?>
<?php echo $form->error($commentForm,'email');?>
</div>
<div class="row">
<?php echo $form->labelEx($commentForm,'content'); ?> :
<?php echo $form->textField($commentForm,'content');?>
<?php echo $form->error($commentForm,'content');?>
</div>
<?php echo $form->hiddenField($commentForm,'post_id',array('value'=>$data->id));?>
<div class="row buttons">
<?php echo CHtml::submitButton('ارسال نظر'); ?>
</div>
<?php $this->endWidget(); ?>
</div><!-- form -->
and this my controller
<?php
class PostController extends CController
{
public function actionIndex()
{
$dataProvider=new CActiveDataProvider('Post', array(
'pagination'=>array(
'pageSize'=>Yii::app()->params->postPerPage,
),
));
$this->render('index',array(
'dataProvider'=>$dataProvider,
));
}
public function actionView()
{
$commentForm = $this->newComment();
$data = Post::model()->findByPk($_GET['id']);
$this->render('view',array('data'=>$data,'commentForm'=>$commentForm));
}
public function newComment()
{
$comment = new Comment();
if(isset($_POST['ajax']) && $_POST['ajax']==='comment-form')
{
echo CActiveForm::validate($comment);
Yii::app()->end();
}
if(isset($_POST['Comment']))
{
$comment->attributes = $_POST['Comment'];
if($comment->validate())
$comment->save();
}
return $comment;
}
}
i checked in firebug and i got this error
[Exception… "Component is not available" nsresult: "0x80040111 (NS_ERROR_NOT_AVAILABLE)" location: "JS frame :: file:///usr/lib/firefox-3.0.8/components/nsSessionStore.js :: sss_saveState :: line 1909" data: no]
[Break on this error] this._writeFile(this._sessionFile, oState.toSource());\n
i’ve tested in firefox 3.0.8 and opera 10