$(document).ready(function() {

	$("#validateOnlyNumbers").keydown(function(event) {

		// Allow only backspace and delete

		if ( event.keyCode == 46 || event.keyCode == 8 ) {

			// let it happen, don't do anything

		}

		else {

			// Ensure that it is a number and stop the keypress

			if (event.keyCode < 48 || event.keyCode > 57 ) {

				event.preventDefault();	

			}	

		}

	});

	

	

	

	

	 $(".validateOnlyNumbers").keypress(function (e) {

     //if the letter is not digit then display error and don't type anything

     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;

    }

   });

   

   

});