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

StackOverflow https://stackoverflow.com/questions/18218543

  •  24-06-2022
  •  | 
  •  

문제

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:

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

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

라이센스 : CC-BY-SA ~와 함께 속성
제휴하지 않습니다 StackOverflow
scroll top