Yiiactiveform Is Not A Function... Again!

Hello, dear community.

I’m a man who called ‘newbie’ here…

I’ve already read a lot of documentation and google-results, also have a Yii.CookBook…

I’ve solved a lot of ‘problems’ caused by myself, but…

Today i met a problem, wich i couldn’t resolve by myself - i’ve got an “yiiactiveform() is not a function” error in my app…

I’ve searched the forum, then google, and have tried a lot of solutions – from ‘jquery.js duplicate’, to ‘CActiveForm properties’ like enableClientValidation…

The situation is that ‘jquery.yiiactiveform.jsis not inlcuded – there’s no correct ‘<script>’ tag at the page, only for ‘jquery.js’.

First of all, i thought i did something wrong with my clientScript and assetManager, even commented all my code…

But then i tried a different way – i’ve created a new application with yiic… and you know – i got same problem on the Contact page of the example application… and there’s also no ‘yiiactiveform’ script!

Please, help me. I don’t know what to do now, and what could be the reason of such system behavior… maybe some system requirements?

P.S. I’ve shot my source code form browser, on the Contact page, and marked my <script> resource.4091


[color="#006400"]NOTE: moved to proper section (General Discussion for Yii 1.1.x instead of INstallation and Setup)[/color]

Hi and welcome to the Yii forum :D

First of all please check the posting guidelines -http://www.yiiframework.com/forum/index.php/topic/19451-guidelines-for-posting-this-forum/

You will get better help if you give all the important and or needed info ;)

So about your problem please post your view code.

Hello, Maurizio.

Thank you for your answer.

I apologize for the posting guidelines non-compliance, will be more careful in the future.

So, the problem manifests on the just created application (containing example site with Contact and Login forms). So, the view file is absolutely standart, there is no any foreign line of source code!

Here is it:



I tried the same procedure on the other server, and everything was ok, ‘yiiactiveform.jquery.js’ was included correctly. I decided this depends on the system requirements, so if i can post any additional information (like phpinfo()) to make a hint with my problem?

p.s. the version of framework is latest, v1.1.13

p.p.s. In the described situation, ‘jquery.yiiactiveform.js’ is correctly published in the assets folder

There is nothing to apologise it’s not about non-compliance it’s just about you getting better help ;)

OK, first of let me explain one thing, the classic contact page generated by default does not have ajax or client validation enabled and that’s why no activeform.js should be included but at the same time you should not get any "yiiactiveform() is not a function"[size=2] message.[/size]



So now please explain a bit more in details your problem.

Do you get that error message on the contact page? If yes then please try to find where and why yiiactiveform() is called.

Do you get that error only on your page? If yes please post the source of that view page.

Maurizio, can u please look into my contact.php file i’ve attached in the previous message.

There is a piece of code:

<?php $form=$this->beginWidget('CActiveForm', array(






)); ?>

And this is a standart page, it’s generated by ‘yiic webapp /path/to/app’ command in each case i’ve tried on the several servers (local and remote). I thought this is a standart in version 1.1.13 …

Ooops… yes, my bad… this has been changed long ago but I don’t use that view so I was still thinking of it as it was once :)

I just tried this and created a new webapp, the contact code is as you posted above and yiiactveform.js is included. I don’t see why it would not be included for you on a clean new created webapp.

Hello, Maurizio.

Sorry for the delay in replying,i had 3-posts-per-first-day limit :)

As I expected, the problem was magical, and i’ve solved it in unbelievable simple way – i’ve just re-downloaded Yii archive and just replaced my YiiRoot folder.

I can not imagine the possible causes of such behavior, but the result is ok :)

Thank u very much for your empathy and help!