<script LANGUAGE="javascript"><!--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>
<form method="POST" name=form action="" onSubmit="return check();"><p align="center"> 请输入电话号码:<input type="text" name="tell" size="20"><input type="submit" value="提交" name="B1"></p></form>
Copyright @ 2007-2012 敏韬网(敏而好学,文韬武略--MinTao.Net)(学习笔记) Inc All Rights Reserved. 闵涛 E_mail:admin@mintao.net(欢迎提供学习资源)
鄂公网安备 42011102001154号
站长:MinTao ICP备案号:鄂ICP备11006601号-18