Discuss / JavaScript / 还没完善

还没完善

Topic source

ApacheTomCat

#1 Created at ... [Delete] [Delete and Lock User]

// TODO: let usernameReg = /^[0-9a-zA-Z]{3,10}$/; // 防止两头符合中间不符合 let passwordReg = /\w{6,20}/; let input_username = document.getElementById('username'); let input_pwd = document.getElementById('password'); let input_pwd2 = document.getElementById('password-2'); if(!usernameReg.test(input_username.value)){ alert('用户名必须是3-10位英文字母或数字,不能为空'); return false; } if(!passwordReg.test(input_pwd.value)){ alert(input_pwd.value); alert('口令必须是6-30位'); return false; } if(input_pwd.value != input_pwd2.value){ alert('两次口令不一致,请重新输入'); return false; } return true;


  • 1

Reply