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

blackberry 10 - how to add multiple markers on the google map just by url? -

php - guestbook returning database data to flash -

java - Using an Integer ArrayList in Android -