<script LANGUAGE="javascript"> <form method="POST" name=form action="" onSubmit="return check();">
<!--
function checkNum(str){return !/\d{6}/.test(str)}
function check()
{
if (document.form.tell.value==""){
alert("請輸入電話號碼!");
document.form.tell.focus();
return false;
}
else{
var Letters = "0123456789()+-";
for (i=0; i< document.form.tell.value.length; i++){
var CheckChar = document.form.tell.value.charAt(i);
if (Letters.indexOf(CheckChar) == -1){
alert("電話號碼格式不正確!");
document.form.tell.focus();
return false;
}
}
}
}
//-->
</script>
<p align="center">
请输入电话号码:<input type="text" name="tell" size="20">
<input type="submit" value="提交" name="B1"></p>
</form>