Trying to make the value validate as integer and is it possible to make it validate as decimal ? As 23,34 (two in front and two after comma)..
jsfiddle:
Trying to make the value validate as integer and is it possible to make it validate as decimal ? As 23,34 (two in front and two after comma)..
jsfiddle:
You can use jQuery.validator.addMethod() method for this:
$.validator.addMethod('decimal', function(value, element) {
return this.optional(element) || /^\d+(\,\d{2,2})?$/.test(value);
}, "Wrong number format, please enter xx.xx value");