﻿// check user info
function sub_mit(){
    if(!GetE("cbPro").checked){alert("您必须同意《UU游戏用户协议》才能注册！"); EventHalt(); return; }
    
    var _v = Trim(GetE("txtUsername").value);
    var _match =/^[a-zA-Z0-9_]{3,20}$/;
    if(!_match.test(_v)){alert("注册用户名长度为3-20个字符,由英文,数字和下划线组成"); EventHalt(); GetE("txtUsername").focus();return; }
    GetE("txtUsername").value = _v;
    
    _v = Trim(GetE("txtPwd").value);
    _match =/^[a-zA-Z0-9_]{6,16}$/;
    if(!_match.test(_v)){alert("密码长度为6-16个字符,由英文,数字和下划线组成"); EventHalt(); GetE("txtPwd").focus();return; }
    
    _v2 = Trim(GetE("txtPwd2").value);
    _match =/^[a-zA-Z0-9_]{6,16}$/;
    if(!_match.test(_v)){alert("密码长度为6-16个字符,由英文,数字和下划线组成"); EventHalt(); GetE("txtPwd2").focus();return; }
    else if(_v != _v2){alert("两次密码不一致"); EventHalt(); GetE("txtPwd2").focus();return;}
    
    if(!confirm("确认注册吗？")){EventHalt(); return;}
}