Follow this Blog!

Sep 19, 2012

Amazon If you use jQuery's form validation plugin at http://docs.jquery.com/Plugins/Validation you may run into problems. It's simply not working! Why? I am doing everything I am asked to do but it is just not working!

Background
One problem is http://docs.jquery.com/Plugins/Validation does NOT tell you EXACTLY what you need to do in order to make everything work. It just asks you to include this line of code

$("#commentForm").validate();
where appropriate and add a bit of metadata on each element to specify the validation rules. But is that really it?

Turns out that it really is it. I am just venting my complaints that it should've been more specific.

Possible Solution
Make sure your HTML form block is correctly nested! Better yet make sure you use XHTML for readability and validation purposes. For example if you have nesting issues such as:

<table><form>
...</form>
</table>
Then the jQuery form validation will NOT work. I ran into this issue when I installed 'pbbooking' plugin, an extension to manage appointments and scheduling, to my Joomla CMS website. Thankfully I fixed this issue as soon as I encountered it. Thought I'd share it with those who didn't see this fix.