Uncaught TypeError: Object [object Object] has no method 'yiiactiveform' when 'enableAjaxValidation'=>true,

3.6k Views Asked by At

In classic gii-generated php code:

$form=$this->beginWidget('CActiveForm', array(
    'id'=>'stuff-form',
    'enableAjaxValidation'=>true, ...

If I set 'enableAjaxValidation'=>true, this javascript error shows up (and validation doesnt work):

Uncaught TypeError: Object [object Object] has no method 'yiiactiveform'
1

There are 1 best solutions below

0
On BEST ANSWER

Apparently the problem was that I have included my own jquery.js.

The solution is to add this line in beginning of the layout:

Yii::app()->clientScript->registerCoreScript('jquery');

related: http://www.yiiframework.com/forum/index.php/topic/17846-jquery-conflict-ajax-validation-not-working/