ami_moor,
<!DOCTYPE html>
<html>
<meta charset="utf-8">
<head>
<script src="http://jqueryvalidation.org/files/lib/jquery-1.11.1.js"></script>
<script src="http://jqueryvalidation.org/files/dist/jquery.validate.js"></script>
<script>
$.validator.setDefaults({
submitHandler: function () {
alert("Всё ок!");
}
});
$.validator.addMethod("captch", function (value, element) {
return /пять/i.test( value )
},
"Вот это фигня а не капча")
$(function () {
$("#commentForm").validate({
rules: {
captchNumber: {
required: true,
captch: true
}
}
})
});
</script>
</head>
<body>
<form method="post" id="commentForm" >
<input id="captchNumber" class="captchNumber required" name="captchNumber" type="text" style="width: 140px" placeholder="введите 5 прописью" />
</form>
</body>
</html>