<html>
<head><title>Sample</title>
<meta http-eqquiv="content-type" content="text/html; charset=utf-8">
<script type="text/javascript">
function checkinput(obj) {
var value = obj.value;
if (value.match(/[^\u3447-\uFA29]/ig)) {
alert("此欄位只能輸入中!");
obj.value = "";
obj.focus();
}
}
</script>
</head>
<body>
<input type="text" onkeyup="checkinput(this)">
</body>
</html>
function checkMobileStrict(v) {
var yd = ['134', '135', '136', '137', '138', '139', '150', '151', '152', '157', '158', '159', '187', '188'];
var lt = ['130', '131', '132', '155', '156', '185', '186'];
var dx = ['133', '153', '180', '189'];
var whole = []; whole = whole.concat(yd, lt, dx);
if (v == '') return 1;
if (v.length != 11) { return 2; }
if (isNaN(v)) { return 2; }
var phone_sect = v.substr(0, 3);
var find = false;
var i = 0;
for (i = 0; (i < whole.length); i++)
{ if (phone_sect == whole[i]) { find = true; break; } }
if (find) return 0; else return 2;
}