javascript - Validation Using jQuery and Regular Expressions -


i need regular expression number started 0 , length of number 11

i find regular expression numbers not length , 0 @ started

$('#mymodal #transfer_charge_model_mob').keyup(function () {             var inputval = $(this).val();             var numericreg = /^\d*[0-9](|.\d*[0-9]|,\d*[0-9])?$/;             if (!numericreg.test(inputval)) {                 $('#mymodal #transfer_charge_model_mob_lbl').text('please enter number');                 $(this).val('');             }             else {                 $('#mymodal #transfer_charge_model_mob_lbl').text('');             }         }); 

you can without regex.

var x = $(this).val(); var y = x * 1; if(!isnan(y))    if (x.charat(0) === '0' && x.length == 11)      //do whatever 

Comments