Fails Validation But Still Submits

sequoiaims 20 Sep, 2011
I am running 4.0 RC2, and trying to get validation to work. I set it to on blur and submit, and if I tab out of a field I get the required bubble, and if I click submit the error bubble shows for a second but then the form submits anyways... It is not a jQuery conflict. Anyone else had this? Thanks.
GreyHead 20 Sep, 2011
Hi sequoiaims,

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

Bob
sequoiaims 20 Sep, 2011
All local in MAMP right now...
Though I found something, I had unset all the default mootools and head scripts to include my own in order. I was calling mootools from Google Ajax libs.. I tried removing that and left original mootools in and it works. Any idea why that would be?
GreyHead 20 Sep, 2011
Hi sequoiaims,

I don’t see why using the Google APIs would cause the problem you describe. Must be some kind of mismatch :-(

Happy to have a look when you have a live version.

Bob
GreyHead 28 Sep, 2011
Hi Ches,

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 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 Joomla! 1.5 system plugin named SC jQuery that allows you to control on which pages jQuery is loaded, and will always load it in no-conflict mode.

Bob
chesne 28 Sep, 2011
Hi Bob,

Thanks for the help.
Because I have jQuery on my site template, I had to use your fix on my template instead of the specific JS code box for the form.
To get the solution I had to wrap all jQuery functions in the noConflict function. I also had to change all $ to "jQuery".
<script type="text/javascript">
        jQuery.noConflict();
	jQuery(document).ready(function(){
            jQuery.preloadCssImages();
            jQuery("#scrolling-menu").show();
            jQuery("div.items").click(function(){ window.location = jQuery(this).attr("url"); });
        }); 
</script>


..... I have never been so happy to see an error message!

Thanks again.
Ches
GreyHead 29 Sep, 2011
Hi Ches,

Nice solution - it's always tricky to find the 'right' place to apply the jQuery fix.

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