javascript - Why is .2 not a valid number for jquery.validate.js? -
this using jquery's validate.
i have textbox if enter 0.2 validates, on .2 fails validation saying has number.
it fails on @html.validationsummary
@ bottom of razor view.
problem .2 not number. anyway make number before hits validation?
you implement small observer fix case number input starts .
this:
$('body').on('blur','input[data-val-number]',function(){ if( this.value[0] == "." ){ this.value = "0" + this.value; $(this).valid(); } });
Comments
Post a Comment