I'm trying to test a very basic jquery validation example. the code is as follows:
<form action="/" method="post">
<input type="text" name="foo" id="foo"/>
</form>
My JS code:
$('#foo').validate({
foo: {
required: true,
minlength: 2
}
});
That doesn't work... Any help or working examples will be appreciated.
.validate()call on the<form>, and name the properties of the validation configuration after the field names? Your field is called "foo", not "name".