I have two or more text fields and I want to apply the same properties to them, avoiding to write two or more times the same code
This doesn\'t work:
$(\
Define your properties as a variable, and then use it:
var name_reqs = { required: true, minlength: 3, maxlength: 50 }; $("#form").validate({ rules: { 'name': name_reqs, 'surname': name_reqs } });