Forums

Placeholder Labels and validation

tlegens 05 Aug, 2013
I am using the placeholder label code I purchased some time ago. I've used it on several websites and have been able to fight through some validation issues I've had. I have one now that has stumped me. The placeholders work great, showing and hiding as they need to in the fields. The validation of the form does not work though. In the interest of preserving the confidentiality of Chronoforms paid extension, i'll just post the part that has the error in my console.

TypeError: jQuery(...).addEvent is not a function
[Break On This Error]

jQuery('submit').addEvent('click', function() {

I've tried not using the no conflict code and the no conflict as shown above. No conflict is loaded in the page above where the code is on the page. I've also tried loading the form placeholder js in an external file with no luck.

Any suggestions or ideas?

Edit: Using Joomla 3.1.4 and the latest Chronoform V4
GreyHead 05 Aug, 2013
Hi tlegens,

I'm not sure what is happening here and I find it a bit confusing.

The Placeholder Labels document was first written for ChronoForms v4 and uses MooTools. Back then jQuery wasn't around in Joomla!. So the code jQuery('submit').addEvent(...) isn't in the tutorial; though $('submit').addEvent(...)

This suggests that on your site the $ variable is being taken over by jQuery. That can happen, except that in Joomla! 3 the two libraries co-exist in the most friendly way I've seen so far and $ is still usable by MooTools.

That is turn suggests that something else on your site is loading a different copy/version of jQuery that is not set up to co-exist with MooTools. Is that what is happening?

Bob

PS In odd moments I'm experimenting with jQuery, Bootstrap and ChronoForms and have the BootStrap placeholder labels and jQuery validation working on a small test.
tlegens 10 Aug, 2013
Bob, I only have one other extension installed and that is a gallery extension that's not on the page. I am however using Gantry framework. I don't see anything in the loading of the resources that would be causing a conflict. You can check it out at the following URL. Maybe you can see something I'm not.

I also noticed that it's not showing the placeholders in IE.

http://custommetalsolutions.com
GreyHead 10 Aug, 2013
Hi tlgens,

As far as I can see the placeholder code has been changed to replace $ with jQuery (I have no idea why) and, what is more JQuery isn’t being loaded on the page so the jQuery.noConflict() line is showing an error.

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