Forums

JS Validation dont work since ...?

michi3000 25 Apr, 2012
Hi
I have Chronform 4 & Joomla 1.5.26
Since some days (i had update to 1.5.26) the chronoform validation dont work. I dont no why and other posts in the forum dont help me...
The captcha verification works, but if i send the form without filling the fields with validation there is a internal server error...

Can you help me please to find a solution?
http://www.soundmk.ch/de/kontakt/form?view=form
GreyHead 25 Apr, 2012
Hi michi3000 ,

Your template (or some other component) is loading the jQuery JavaScript library.

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 that allows you to control on which pages jQuery is loaded, and will always load it in no-conflict mode. However this requires that JQuery is loaded using the Joomla Document object methods.

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
michi3000 26 Apr, 2012
Hi Bob
Thanks for you support!
I install the JB Library Plugin and add "jQuery.noConflict();" in the java script box of the form,
but saddly the validation dont work...
Then i check your "ChronoForms v4 How-to doc, Resolving jQuery problems", check another template and without a template and the validation still dont work, hm...

Whats the next thing that i have to do?

Thanks a lot and best to you
Michi
GreyHead 28 Apr, 2012
Hi Michi,

You have to resolve the JavaScript errors on your page: here's the list I see in FireFox viewing the form with (or without) the template

jQuery is not defined
index.php?option=com_chronoforms&lang=de&tmpl=component&chronoform=Kontaktform&event=submit()index....=submit (line 3)
[Break On This Error]

...d" type="text" value="" name="input_text_7" /><div class="clear"></div><div id="...

index....=submit (line 3)
window.addEvent is not a function
[Break On This Error]

...d" type="text" value="" name="input_text_7" /><div class="clear"></div><div id="...

index....=submit (line 3)
$empty is not defined
0a848f85cf5c400039712fb178aaa777.js()0a848f...a777.js (line 103)
[Break On This Error]

...d[1];var e=c.value.replace(/[ \t\v\n\r\f\p]/m," ").replace(/[,.;:]/g," ").clean(...

0a848f...a777.js (line 103)


I'm afraid that these problems are a consequence of your choosing to use JQuery on a Joomla! site without having it put into no Conflict mode.

In this case it looks as though the noConflict code is being added before JQuery is loaded so it adds an extra error to the list.

Bob
abseve 12 Nov, 2013

Hi michi3000 ,

Your template (or some other component) is loading the jQuery JavaScript library.

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 that allows you to control on which pages jQuery is loaded, and will always load it in no-conflict mode. However this requires that JQuery is loaded using the Joomla Document object methods.

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


Is is still the case with the new version of chronoforms 4.0.2 ?
My form is not validating when using the default template.
When I switch template, it is validating fields left empty?
I wasted time figuring out what's wrong with my forms only to know there's a possible jquery conflict. How do I fix this?
GreyHead 13 Nov, 2013
Hi abseve,

That's an unanswerable question. There's no problem with ChronoForms v 4.0.2 (or any other version). The problem is whether the rest of your site content, and in particular any other parts that use jQuery, or other JavaScript, is properly managed. If there are JavaScript errors on the page then there is a good chance that they will break the ChronoForms validation.

The solution has several steps:

a) Test your form using the 'Test Form' icon in the ChronoForms Toolbar, this shows the form in the front-end without the template (provided that your template is well-behaved). If the validation doesn’t work here then there are problems with the form; in my experience 98%+ of the time this works OK.

b) Test your form with the Frontend view link in the forms Manager. This displays the form in the front end without using the plug-in, module or menu items. If there is an error here then you can use your browser web-developer tools to check for JavaScript errors on the Console tab.

c) Test your form in its final location if that is different from b above.

At each step fix any errors that you find.

Bob

Bob
This topic is locked and no more replies can be posted.