Introduction
Today, I am going to explain about numeric validation using Jquery. Jquery plays a great role to validate data at client side without refreshing whole the page. To make your application more user friendly, interactive and soothing then Jquery plays a vital role to fulfill your dreams.Data Input Text Box
Number :
While typing in Input box other Numeric showing error message
Jquery Code Snippet
$(document).ready(function () {
  //on keypressed in textbox
  $("#age").keypress(function (e) {
     //if not numeric, then it don't let you type
     if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57)) {
        //display error message
        $("#errmsg").html("Digits Only").show().fadeOut("slow");
               return false;
    }
   });
});
Numeric Jquery CSS Code
#errmsg
{
color: red;
}


Post A Comment:
0 comments: