最新消息:Welcome to the puzzle paradise for programmers! Here, a well-designed puzzle awaits you. From code logic puzzles to algorithmic challenges, each level is closely centered on the programmer's expertise and skills. Whether you're a novice programmer or an experienced tech guru, you'll find your own challenges on this site. In the process of solving puzzles, you can not only exercise your thinking skills, but also deepen your understanding and application of programming knowledge. Come to start this puzzle journey full of wisdom and challenges, with many programmers to compete with each other and show your programming wisdom! Translated with DeepL.com (free version)

jQuery Live Form Validation in Wordpress

matteradmin4PV0评论

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.

Articles related to this article

Post a comment

comment list (0)

  1. No comments so far