jQuery JavaScript Library v1.3.2
jQuery validation plug-in 1.5.2

I think I'm using this plug-in straight from the examples for a simple
form.  No matter what I have as the last option I get a similar error,
in the case:

$("#short-form").validate is not a function
privacy_policy: "Please accept our privacy policy"

This also throws an error:
jQuery.validator is undefined in additional-methods.js
jQuery.validator.addMethod("maxWords", function(value, element,
params) {

Sorta pulling my hair out at this point as I can't figure out what's
causing either.

Form HTML: (if more HTML would help let me know)
<form id="short-form" name="short-form" action="<!-- cut action -->"
method="post">
        <label for="name" class="first">Name</label>
        <input type="text" class="text" name="name" id="name" value="Your
Full Name" />
        <label for="email">Email Address</label>
        <input type="text" class="text" name="email" id="email"
value="y...@youremail.com" />
        <fieldset>
                <input type="checkbox" class="checkbox" name="news_updates"
id="news_updates" value="yes" /><label for="news_updates" class="float-
right">Yes, email me news and updates</label>

                <input type="checkbox" class="checkbox" name="privacy_policy"
id="privacy_policy" value="yes" /><label for="privacy_policy"
class="float-right">I have read and understand the <a href="#">privacy
policy</a></label>
        </fieldset>
        <label for="birth_year">Year of Birth</label>
        <select id="birth_year" name="birth_year">
<option label="" value="null">Birth Year</option>
<!-- cut remaining options-->
        </select>
        <button type="submit" id="sign-up" value="sign-up">Sign Up</button>
<!-- cut hidden fields -->
</form>

Javascript:
$(document).ready(function() {
        $("#short-form").validate({
                rules: {
                        name: {
                                required: true,
                                minlength: 2
                        },
                        email: {
                                required: true,
                                email: true
                        },
                        birth_year: {
                                required: true
                        },
                        privacy_policy: {
                                required: true
                        }
                },
                messages: {
                        name: {
                                required: "Please enter a username",
                                minlength: "Your username must consist of at 
least 2 characters"
                        },
                        email:  "Please enter a valid email address",
                        birth_year:  "You must select a Birth Year",
                        privacy_policy: "Please accept our privacy policy"
                }
        });
});

Reply via email to