Not able to validate through ajax

I am using in my details model rules


array('gender,age', 'required' ,'on' => 'bassearch'),

I am using the bassearch action in my site controller in the actionbassearch I have





$model= new Details;


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

		{

			

			echo "hi";

			echo CActiveForm::validate($model);

			Yii::app()->end();

			

			

		}






In My view/site/index.php I have


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

	'id'=>'search-form',


'action'=>'index.php?r=site/bassearch',

	'enableClientValidation'=>true,

'enableAjaxValidation'=>true,

	'clientOptions'=>array(

		'validateOnSubmit'=>true,

'validateOnChange'=>true,

'validateOnType'=>false,


	),

)); ?>

I am still not able to validate through ajax

I had the same problem.

The first thing I see is that you dont assign scenario

or remove the on=> condition or change to Details(‘bassearch’);

You mean it should be on=>‘Details(‘bassearch’)’

In Firebug it is showing me


$("#search-form").yiiactiveform is not a function