Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

jQuery(...).activeform is not a function in Yii

I am developing a project with Yii.

I need to use jquery ui on many pages of site. So I add jquery core library and jquery ui library in the layout of site to have access to them on all the pages.

But it causes problem on the pages which have a form (active form). I see this error on the firebug :

jQuery(...).activeform is not a function

why is it so? How can I resolve it?

Thank you.

like image 407
hd. Avatar asked May 30 '13 08:05

hd.


1 Answers

If you include jQuery core libraries manually in your layout file, it could be possible that jQuery gets loaded a second time and overrides the original jQuery object which had the Yii plugins attached.

You should use Yii::app()->clientScript->registerCoreScript('jquery.ui') instead.

like image 173
Michael Härtl Avatar answered Oct 08 '22 04:10

Michael Härtl