is not in the main layout. but definitely included jquery…
public function actionIndex()
{
//create new user
$model = new Users;
$profile = new Profile;
if(isset($_POST['ajax']))
{
echo CActiveForm::validate($model);
Yii::app()->end();
}
.....
public function actionIndex()
{
//create new user
$user = new Users;
$profile = new Profile;
$this->performAjaxValidation(array($user, $profile));
if (isset($_POST['User'])) {
$user->attributes = $_POST['User'];
........
}
.....
Also in this controller you will need (may already be there):
/**
* Performs the AJAX validation.
* @param CModel the model to be validated
*/
protected function performAjaxValidation($validate) {
if (isset($_POST['ajax']) && $_POST['ajax'] === 'first-form') {
echo CActiveForm::validate($validate);
Yii::app()->end();
}
}