[solved] Ajax Validation not working (CActiveForm)

Yii 1.1.3

Webapp created using yiic tool

I am testing using the generated Contact Form.


<div class="form">

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



)); ?>

[form fields]

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

</div><!-- form -->


public function actionContact()


	$model=new ContactForm;


	// Uncomment the following line if AJAX validation is needed












		$this->render('contact', array('model'=>$model));



	protected function performAjaxValidation($model)


		if(isset($_POST['ajax']) && $_POST['ajax']==='contact-form')


			echo CActiveForm::validate($model);





I have not modified ContactForm model. Normal validation is working fine.

jquery.js is included but yiiactiveform.js is not being included for some reason. I have not disabled it anywhere.

EDIT: I got my answer - I had removed $form->error() from my input fields.

Thank you.I have spend a lot of time to resolve it;

The easiest errors are always hardest to find! :] Glad, you found it after all.

This should be somewhere explain in very clear manners how this AJAX VALIDATION WORKS…

Especially $form->error() Hint…