function IsEmail(str) { var r = /^[a-zA-Z0-9._%-]+@[a-zA-Z0-9.-]+\.[a-zA-Z]{2,4}$/; if (r.test(str)) { return true; } else { return false; } } function IsTel(str) { var s = /^(\d{2,4})(-(\d{7,8}))$/; if (s.test(str)) { return true; } else { return fa…
验证输入的name只能是数字或字母或下划线 js <script type="text/javascript"> function submitOn(){ var f = document.getElementById("userfrm"); var isValiUserName = false, isValiPassword = false; var userNameStr = f.username.value; var passwordStr = f…