[Solved] Failed Ajax Validation : Redefinition Of Js File? Jquery(...).yiiactiveform Is Not A Function

JQuery Conflict - Ajax Validation Not working

Hi everybody. and thx for reading :)

I have a strange error. :s

my error appear in firebug when I set enableAjaxValidation, or enableClientValidation to true.

In my layout I called JS like this :

When my page with the activeForm is loaded, my JS is loaded like this :

In my view I have :

In My controller I have :

Where is the problem ? The redefinition of the JS is a problem?

is it something else?

I already tried this without any success…

and

(I put this in the head of my layout but I don’t really understand it’s purpose… )

thx in advance for your help :)

Hi,

you are loading jquery 2 times look at the code…

try to avoid duplicate jquery …i hope it will solve your problems

<script src="/LayoutColloques/assets/461bd74a/jquery.js" type="text/javascript"></script>

[size=2]<script src="/LayoutColloques/javascript/jquery.min.js" type="text/javascript"></script>[/size]

[size=2]

[/size]

[size=2]

[/size]

yes I know, but, this line :

<script src="/LayoutColloques/assets/461bd74a/jquery.js" type="text/javascript"></script>

is autogenerated by the widget I think. I didn’t call it. In My layout I call only

and I need it on each page to expand my menu.

It is possible to ask to the widget to call

<script src="/LayoutColloques/assets/461bd74a/jquery.js" type="text/javascript"></script>

<script src="/LayoutColloques/assets/461bd74a/jquery.yiiactiveform.js" type="text/javascript"></script>

in a different place? like under the CActiveForm, or just above it?

I don’t understand… but I comment this line :

And it works…

My hidded menu too …

there is no logic in this, isn’t it?

Anyway, thx a lot and have a good day.

(can I change the name of the topic whith "solved" tag? )

Hi vincent,

There is a logic behind this…

I think u have jquery in your javascript folder (static file)

yii automatically solve some dependency for widget… so its load one more time … thats all…

I hope my statement is clear for you :)

Have a nice day