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

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

  •  19-10-2022
  •  | 
  •  

문제

I am using Yii form Like this.

 <?php $form=$this->beginWidget('CActiveForm', array(
                    'id'=>'customerContactForm',
                     'action' => array( '/customer/ContactFormEmail' ), 
                    'enableClientValidation'=>true,
                    'clientOptions'=>array(
                        'validateOnSubmit'=>true,
                                       ));>?

On console I Got this error,

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

But after searching about this problem,I add this line of code to my view file.

<script type="text/javascript" src="../assets/795f6a2f/jquery.yiiactiveform.js"> </script>

It start working,But I do not want to get js from assets folder.So I try this

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

But I am getting the same problem.

올바른 솔루션이 없습니다

다른 팁

You must connect Jquery Before than yiiactiveform. As is often the case that the Jquery file is connected to the page twice. You need to remove the explicit connection Jquery in view code. The framework will decide when it needs.

If you do need one to do it manually - insert only the following code in the page header: Yii::app()->clientScript->registerCoreScript ('jquery');

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