<script>
function checkNUM(val) {
var o = document.getElementById("TextBox1");
if (o.value.substring(0, 1) != "3" && o.value.substring(0, 1) != "6" && o.value.substring(0, 1) != "8" && o.value.substring(0, 1) != "9") {
o.value = '';
o.focus();
return false;
}
for (var i = 0; i < o.value.length; i++) {
if (isNaN(o.value)) {
o.value = '';
o.focus();
return false;
}
}
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
<asp:TextBox ID="TextBox1" runat="server" MaxLength="8" οnkeyup="return checkNUM(this)"></asp:TextBox>
</div>
</form>
</body>