jQuery Live Form Validation in Wordpress

admin2025-04-26  7

I'm trying to implement the form validation that can be found at: /

I can get the demo above working, but when I implement it on my wordpress site no validation occurs.

The page where it's implemented is here: /

You'll see that the neccesary scripts are included:

  1. jquery.validate.js?ver=3.8
  2. jquery.js?ver=1.10.2
  3. form-validation.css?ver=3.8

as well as the necessary code in the head:

jQuery(function(){
        jQuery("#firstname").validate({
            expression: "if (VAL.match(/^[A-Za-z '-]{3,20}$/) && VAL) return true; else return false;",
            message: "Required."
        });
    });

etc....

As far as I can tell, the form itself is all okay. Still no validation.

I'm trying to implement the form validation that can be found at: http://www.geektantra/2009/09/jquery-live-form-validation/

I can get the demo above working, but when I implement it on my wordpress site no validation occurs.

The page where it's implemented is here: http://www.melbournemeditationcentre/meditation-courses/course-registration/

You'll see that the neccesary scripts are included:

  1. jquery.validate.js?ver=3.8
  2. jquery.js?ver=1.10.2
  3. form-validation.css?ver=3.8

as well as the necessary code in the head:

jQuery(function(){
        jQuery("#firstname").validate({
            expression: "if (VAL.match(/^[A-Za-z '-]{3,20}$/) && VAL) return true; else return false;",
            message: "Required."
        });
    });

etc....

As far as I can tell, the form itself is all okay. Still no validation.

Share Improve this question edited Dec 15, 2013 at 7:16 Subharanjan 1,5891 gold badge17 silver badges29 bronze badges asked Dec 15, 2013 at 5:36 whymattwhymatt 133 bronze badges
Add a comment  | 

1 Answer 1

Reset to default -1

Your page through javascript errors. Try loading the validation scripts on footer (before closing </body> tag) rather than within header (within <head> tag).

If that doesn't work, then try editing the jquery.validate.js file, and replace the first line (function(jQuery){ with (function($){. It should work.

转载请注明原文地址:http://conceptsofalgorithm.com/Algorithm/1745657779a312554.html

最新回复(0)