Forums

Form Validation Error CF v4

fendoy 04 May, 2011
Hi..

I encountered an error, and this is the message:

------------------------------------------------------------------------------------

this.form.getProperty is not a function
[Break On This Error] var FormCheck=new Class({Implements:[O...t("validateFailure");return false}}});

------------------------------------------------------------------------------------

and the location is: formcheck-yui.js (line 1)

I used Firebug to locate the error.

How do I fix this? Is it because it's conflicting with jQuery?

Thank you,
fendy
GreyHead 04 May, 2011
Hi fendy,

If you have JQuery loaded then probably yes that is the problem. Otherwise the MooTools library may not be loading correctly.

Please post a link to the form so we can take a quick look.

Bob
fendoy 11 May, 2011
Hey Bob,

Sorry it is on my local server, and sorry for the late reply.

I tried to unload the jQuery and it works perfectly.

Do you have any suggestion if I still want to use jQuery? Is there anything to trick this?

Thanks alot
fendoy 11 May, 2011
Hey Bob,

I found how to fix that. Thanks for pointing the problem🙂

If still want to keep the jQuery scripts, then solution is by doing:

//define a no conflict variable
var $j = jQuery.noConflict();


//and always start with the variable to run any jquery e.g. ...
$j("div").fadeOut();


hope this will help others.
Pamenja 14 May, 2011
Hi all,

I ran into the same problem on a site that I did not build myself. Joomla indeed used both Mootools and Jquery. Problem was that because of that the variable 'this.form' was not properly set.

Reason: Jquery does not know this function. Whereas Mootools does.

What I did was change this part in formcheck-yui.js:
from:
initialize:function(b,a){if(this.form=$(b))

to:
initialize:function(b,a){if(this.form=document.id(b))


This solved my problem without having to install a third-party plugin, and I just had to change one line of text.
GreyHead 22 May, 2011
Hi Pamenja ,

FormCheck requires MooTools so probably not good to hack the code like this. If JQuery is running on the site then it needs to be put into NoConflict mode to avoid problems.

Bob
elehost 13 Jun, 2011

Hi all,

Reason: Jquery does not know this function. Whereas Mootools does.

What I did was change this part in formcheck-yui.js:
from:

initialize:function(b,a){if(this.form=$(b))

to:
initialize:function(b,a){if(this.form=document.id(b))



This helped me solve the same issue on my end (as a quick fix).

Thanks for posting it.
needshelp 12 Aug, 2011
It seems you just have to add the following right after you call your jquery code, depending on how you programmed your mootools perhaps but this worked for me, right after my jquery framework load add the following;

<script type="text/javascript">
  $.noConflict();
  // Code that uses other library's $ can follow here.
</script>
plastic1st 26 Feb, 2014


It seems you just have to add the following right after you call your jquery code, depending on how you programmed your mootools perhaps but this worked for me, right after my jquery framework load add the following;

Code: Select all
<script type="text/javascript">
$.noConflict();
// Code that uses other library's $ can follow here.
</script>




THANK YOU needshelp !!!!
YOU SAVE MY DAY 😛
This topic is locked and no more replies can be posted.