Validating single digit number in textbox in javascript

Jan 13 2009 12:45 AM

hi,

 

I have done like below for validating the numbers in textbox.

function IsNumeric()

{

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

{

event.returnValue=false;

if(event.keyCode!=13 && document.form1.txtKPA.focus==true)

{

alert('KPA Rating should be numeric);

}

}

}

please let me kow the code for validating single digit number.

Regards,

Geetha

 


Answers (1)