// TODO: var username = document.getElementById('username').value, pwd1 = document.getElementById('password').value, pwd2 = document.getElementById('password-2').value, MYAPP = {}, reUsername = /^[\w\d]{3,10}$/, rePwd = /^[\w\d]{6,20}$/; MYAPP.ret = true; if (reUsername.exec(username) === null) { alert('Invalid Username!'); MYAPP.ret = false; } if ((rePwd.exec(pwd1) === null) || (rePwd.exec(pwd2) === null)) { alert('Invalid Password!'); MYAPP.ret = false; } if (pwd1 != pwd2) { alert('Two password are not same!'); MYAPP.ret = false; } return MYAPP.ret; }
Sign in to make a reply
为谁守专一