Forums

JS validation doesn't work on second template

lestatu2 21 May, 2012
I Built a site with 2 templates

one for home and one for other pages

I built 2 form one for home and another for any site page with CF4

js validation works well on home form but doesn't work on other pages

this is the home form: http://www.astegiudiziariepalermo.com/ (all works with tips error)
this is the other pages form http://www.astegiudiziariepalermo.com/index.php/diventa-cliente (only eroor message on captacha on submit)

and this is the pure other page form link where everything works:

http://www.astegiudiziariepalermo.com/index.php?option=com_chronoforms&chronoform=form_home-Copy


Can someone help me?
GreyHead 22 May, 2012
Hi lestatu2,

You have three different versions of JQuery loading - you need to get JQuery into noConflict mode (and preferably only load one version).

Out of the box jQuery isn't compatible with the MooTools library used by Joomla! and ChronoForms. You can use jQuery with MooTools in no-conflict mode. There are various ways of doing this. The simplest - which may or may not work - is to add a line of script in the ChronoForms Form JavaScript box:
jQuery.noConflict();
This will free the $ operator which is used by MooTools, so you may need to update your own javascripts to use the longer jQuery operator.

There is also a neat plugin named JB Library from Joomla! Bamboo and another named InterExt from AcuIT that allow you to control on which pages jQuery is loaded, and will always load it in no-conflict mode. However these requires that JQuery is loaded using the Joomla Document object methods. The InterExt extension allows you to select menu items to load JQuery.

I have a tutorial on Resolving jQuery problems that explores some of the issues an diagnostics and shows how to modify one template example to use the Joomla! Document methods to load JQuery in noConflict mode.

Bob
lestatu2 22 May, 2012
thanks bob, already read about "jQuery.noConflict();" but it doesn't work

now it's time to learn what you wrote


thanks a lot
lestatu2 22 May, 2012
thanksssssssssssssssssss bob

I used jb library and I enabled Unique jQuery

now it works

thanks again you're my hero
This topic is locked and no more replies can be posted.