I have the code that you can check in this fiddle: http://jsfiddle.net/4SCrp/5/
<form id="my_form">
<input id="formfield1" type="text" maxlength="3" value="">
<br/>
<input id="formfield2" type="text" maxlength="3" value="">
<br/>
<input type="submit" value="submit">
</form>
and th followin script using jquery.validate plugin
$("#my_form").validate();
$('#formfield1').rules('add', {
required: true,
digits: true,
max: 255
});
$('#formfield2').rules('add', {
required: true,
digits: true,
max: 2
});
It is supposed to acept a maximum of 255 in the first field and a maximum of 2 in the second. But both give the error "Please enter a value less than or equal to 2." so it takes for all the last max defined.
Do you know how to solve that problem?