I have used http://bassistance.de/jquery-plugins/jquery-plugin-validation/
my form validate :
$(\"#form_person\").validate({
rules: {
u
Since jquery-validation 1.15.0 a cleaner approach is to use the normalizer callback:
$( "#myform" ).validate( {
rules: {
field: {
required: true,
normalizer: function( value ) {
return $.trim( value );
}
}
}
} );
The normalizer (immutably) transforms the value before the validation takes place.
See the Normalizer Docs for more details.