Easiest way is to do it in Javascript:
<html>
<head>
<script language=Javascript>
</script>
</head>
<body>
<input id="tbChar" onkeypress="return isNumberKey(event)" type="text" name="tbChar">
</body>
</html>
That allows '.' 0' - '9' only, and it is pretty simple for you to reverse.