How to enable ajax validation in CForm config file ?

I need create a form from config file with CForm, then how to enable ajax in the CForm config file ?



look here

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



        'clientOptions' => array(





)); ?>

Actually if you not using CActiveForm I think you should write your own javascript for that…

or include manually the CActiveForm javascript and manipulate it… but better just create some FormModel

Kabinenkoffer nice to see my comment help :lol:

dckurushin: reuse, reuse, reuse

frist you should add ‘enableAjaxValidation’=>true in the widget CActiveForm also uncomment the line from the controller $this->performAjaxValidation($model);. Please confrim that there is function inside your controller

protected function performAjaxValidation($model)


	if(isset(&#036;_POST['ajax']) &amp;&amp; &#036;_POST['ajax']==='branch-form')


		echo CActiveForm::validate(&#036;model);