<html>>
<HEAD>
<SCRIPT language=Javascript>
<!--
function isNumberKey(evt,val)
{
var charCode = (evt.which) ? evt.which : event.keyCode
if (charCode > 31 && (charCode < 48 || charCode > 57))
{
alert("Mention the time correctly");
return false;
}
else
{
if(val>23)
{
return false;
alert("Mention the time correctly");
}
else
{
return true;
}
}
}
</SCRIPT>
</HEAD>
<BODY>
<INPUT id="txtChar" onkeypress="return isNumberKey(event,this.value)" type="text" name="txtChar">
</BODY>
</HTML>