SO jQuery Fiddle
Test Fiddle mainly for SO Questions jQuery 1.4.3, UI 1.8.5
by Kishore Polsani
HTML
<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8.5/themes/ui-lightness/jquery-ui.css">
<script src="http://ajax.microsoft.com/ajax/jquery.validate/1.7/jquery.validate.js"></script>
<form>
<input type="text" name="test" />
<button type="submit">Test</button>
</form>
JavaScript
jQuery.validator.addMethod("equals", function(value, element, param) {
return this.optional(element) || value === param;
}, jQuery.format("You must enter {0}"));
$("form").validate({
rules: {
test: {
required: true,
equals: "string to check"
}
},
debug: true
});