<script language="javascript">
function checkInput() {
window.alert(form1.txt_nApply_dt.value.length);
window.alert(event.keyCode);
if (((event.keyCode >= 48) && (event.keyCode <= 57)) || ((event.keyCode >= 96) && (event.keyCode <= 105)) || event.keyCode == 8 || event.keyCode == 9 || event.keyCode == 37 || event.keyCode == 39) {
window.alert('true');
//return true;
}
else {
window.alert('false');
//return false;
event.keyCode = 0;
}
}
</script>
<asp:TextBox ID="txt_nApply_dt" runat="server" Width="60px" MaxLength="8" onkeypress="checkInput();"></asp:TextBox>
全站熱搜
留言列表