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'
Apparently the problem was that I have included my own jquery.js.
The solution is to add this line in beginning of the layout:
related: http://www.yiiframework.com/forum/index.php/topic/17846-jquery-conflict-ajax-validation-not-working/