zoinx2010,
так и эдак хорошо
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script src="http://code.jquery.com/jquery-1.9.1.js"></script>
<script src="http://jquery.bassistance.de/validate/jquery.validate.js"></script>
<script>
$.validator.setDefaults({
submitHandler: function () {
alert("submitted!");
}
});
$.validator.addMethod("test", function (value, element) {
return !/(\d)\1{2,}/.test(value);
},
"Вот это фигня")
$(function () {
$("#commentForm").validate({
rules: {
field: {
required: true,
test: true
}
}
})
});
</script>
</head>
<body>
<form class="cmxform" id="commentForm" method="get" action="">
<fieldset>
<p><input class="left" id="field" name="field"></p>
<p>
<input class="submit" type="submit" value="Submit"/>
</p>
</fieldset>
</form>
</body>
</html>