Forums

Form Validation Not Working within Template

advantech 13 Jan, 2011
Hello,

http://www.gomodularhomes.com/portal/contact-us

I created a Contact Us form using Chronoforms on a joomla site. However, validation is not working. Originally I was getting "error 1. " but downloaded the workaround file, which seemed to take care of that error. The form submits without warning that required fields are to be completed (validation). I've been searching for days now, and can't figure this one out. I've read over and over that its most likely due to JQuery, but I do not have jquery installed and I believe I removed all jquery scripts from my template. I'm a novice with joomla, Please help....!

Note: I know the issue lies somewhere in my template, the form works outside the template, shown here:
http://www.gomodularhomes.com/portal/?option=com_chronocontact&tmpl=component&chronoformname=ContactUs

Thanks in advance,
Crystal
GreyHead 13 Jan, 2011
Hi Crystal,

Indeed JQuery isn't loading . . but neither is the MooTools library that ChronoForms uses. I'm not sure why this is, maybe your template suppresses it.

Try adding this code snippet to the start of the Form HTML and see if that fixes it:
<?php
JHTML::_('behavior.mootools');
?>

Bob
advantech 13 Jan, 2011
Hi Bob,

I added the code per your suggestion, but am still experiencing the same issue.

Crystal
GreyHead 13 Jan, 2011
Hi Crystal,

I'm afraid that there is something broken or missing in the template. If you view the form without the tempalte then everything looks OK.
It may be that the template is just missing some of the placeholders needed for Joomla! to insert the header code.

Bob
pat01 13 Jan, 2011
Hi Crystal

A quick view at the error console of FireFox shows me many errors:

Fehler: Class is not defined
Quelldatei: http://www.gomodularhomes.com/portal/components/com_chronocontact/js/calendar2.js
Zeile: 4
Fehler: Element.extend is not a function
Quelldatei: http://www.gomodularhomes.com/portal/contact-us
Zeile: 36
Fehler: window.addEvent is not a function
Quelldatei: http://www.gomodularhomes.com/portal/contact-us
Zeile: 45

[ and a few more ! ]

Don't know how experienced you are in investigating this 🙄

Anyway, it's possible that some JavaScript files which are loaded inside of your template cause the problem. Such as
<script type="text/javascript" src="/portal/templates/gomodularhomes/scripts/cufon-yui.js"></script>
<script type="text/javascript" src="/portal/templates/gomodularhomes/scripts/FreeSetC_400.font.js"></script>
<script type="text/javascript" src="/portal/templates/gomodularhomes/scripts/cufon-replace.js"></script>


You could open the index.php file and remove any code loading template based (!) JavaScript there (make a backup copy of the file first). After that and if your form is working now, add one file by one back to the template file, until the problem is back.

Compare your index.php with an original one from an original template such as beez or rhu_milkyway.

Regards
Patrick
GreyHead 13 Jan, 2011
Hi Patrick,

I think that most of those errors are because MooTools isn't loaded and all the MooTools dependent scripts then break :-(

Bob
advantech 13 Jan, 2011
Patrick,

Thank you for your help. I removed the JavaScript from the index.php file of the template, but am still experiencing the validation issue. Must be something else. Do you still get the errors you mentioned?

Hope to hear from you,
Crystal
pat01 14 Jan, 2011

I think that most of those errors are because MooTools isn't loaded and all the MooTools dependent scripts then break


Hi Bob

Yes, that could explain it.


@Crystal
No errors any more, but CF is not loading either...

Maybe you better look for another template since the actual one causes so many problems...? 🙄 😀

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