Forums

Validation conflict with jquery

marianneC 13 Jun, 2017
Hello,
I'm on joomla last version and I have an issue with my chrono forms validation. I had to add a jquery file in my theme, and it looks like it crashes the validation js. What can I do?

In the console:
"Uncaught TypeError: Cannot read property 'forms' of undefined
at HTMLFormElement.<anonymous> (e5cbf2c….js:683)
at Function.each (jquery.js:2)
at r.fn.init.each (jquery.js:2)
at Object.$.G2.forms.ready (e5cbf2c….js:681)
at HTMLDocument.<anonymous> (index.php?option=com_chronoforms6&view=form&Itemid=114:27)
at i (jquery.min.js:2)
at Object.fireWith [as resolveWith] (jquery.min.js:2)
at Function.ready (jquery.min.js:2)
at HTMLDocument.K (jquery.min.js:2)"
Max_admin 13 Jun, 2017
Hello Marianne,

Where did you add this file reference exactly ? it should be added in the template <head>, if this doe not help then please send me a link to the form page so I can test this myself.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
marianneC 16 Jun, 2017
I use a template by YOOtheme. To add custom JS I have to put it in a specific folder. There is a theme.config.php there were I link the files

<?php

require(__DIR__.'/../../../layouts/theme.config.php');

// add script
$this['asset']->addFile('js', 'js:jquery.js');
$this['asset']->addFile('js', 'js:sidebar-fixed.js');

?>

I checked in the source code, it goes in the <head> section...
Max_admin 16 Jun, 2017
Hi Marianne,

Please try to remove the "jquery" file reference you have added as there is already a jquery file loaded on the page.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
marianneC 19 Jun, 2017
Then my custom JS only works on the page I put the form. It looks like you only load your jquery file on this page.
Max_admin 19 Jun, 2017
Hi Marianne,

No, you have a jquery loaded by your website, its the first line in the screenshot you have already posted, Chronoforms uses that one, it does not load its own jQuery file.

Best regards,
Max
Max, ChronoForms developer
ChronoMyAdmin: Database administration within Joomla, no phpMyAdmin needed.
ChronoMails simplifies Joomla email: newsletters, logging, and custom templates.
This topic is locked and no more replies can be posted.