Hi Guys

This is now my second day struggling with this problem. I have web form which I have created with webforms module. I have created two markup fields:

1. head -> has jquery validation rules for form objects
2. html -> has html markup for fields etc.

Now i know i should be using the webforms fields but due to a long and complicated story I have set up my own fields using html and will handle the data processing in the additional processing section of the webform. My problem is this:

I am handling all validation using the jQuery plugin (validation) by specifying rules in the javascript (which i have added to the head markup field). The normal jQuery functionality is working great as field effects, hiding etc are working but i cannot get the validation to work. I have tried adding the validation file using jquery_plugins module in the page.tpl.php file, template.php file (as per other answers on the forum) but i get nothing. Every time I click that button it just posts the form without any validation. The only two things i can think of is either the form name which is not being referenced correctly E.g.

$("#webform-client-form-2324").validate({
rules: { ... }
});

or drupal is not seeing the javascript plugin file for the jQuery validation plugin E.g.

jquery_plugin_add('validate'); print $scripts;

If i view the page source for the form the only javascript file i see referenced is this:

script type="text/javascript" src="/fsp6/sites/default/files/js/0d8c43b8f264eb1633332e5f58105492.js">

Any help would be greatly appreciated.

Comments

Gerald Mengisen’s picture

In order to see multiple JavaScript files loading, go to the Site Configuration - Performance menu and set "Optimize JavaScript files" to disabled. Then you'll be able to see the multiple JavaScript files.

Next, the article Debugging JavaScripts should give you some pointers where to continue. Without a debugger, you're left in the dark.

Some jQuery libraries are zipped and have also an unzipped version for debugging. Make sure you have deployed the unzipped version until you know what it going on.

Hope this helps,
Gerald