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?

jsfiddle demo

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

Popular posts from this blog

python - How to create a legend for 3D bar in matplotlib? -

java - Multi-Label Document Classification -

php - Dynamic url re-writing using htaccess -