12 December 2010

Allow numeric values only in input field using jQuery


$("#input1").keypress(function(e)
{
  // allow digits only
  if (e.which != 8 && e.which != 0 && (e.which < 48 || e.which > 57))
  {
    return false;
  }
});

5 comments:

Your comments, Feedbacks and Suggestions are very much valuable to me :)

Things are upgraded

My Dear readers, I am really thankful for being supportive all these years. This site was the first blog site I ever created in my life...