In the examples for the jQuery Validate plugin, I see three different approaches to declaring validation rules:
You can apply rules trough data-rule attributes. This is the easiest way and possibly the best way to maintain a clean code...
Example:
You can even provide messages through data attributes:
In JavaScript just call:
$('#myform').validate();