<input name="username" type="text" autocomplete="off" placeholder="手机号码或者QQ号或者QQ邮箱" maxlength="20"
class="input-text" datatype="/^1[3|4|5|7|8][0-9]{9}$/ | /^[1-9]\d{4,14}$/ | /^[1-9]\d{4,14}@(qq|QQ).com$/" nullmsg="请输入用户名!"sucmsg="用户名格式正确!" errormsg="手机号码或者QQ号或者QQ邮箱"/>
#set( $basePath = "$request.contextPath" )
#set( $staticPath = "$basePath/assets" )
#parse("/common/header.vm")
<div class="pd-20">
<form method="post" class="form form-horizontal" id="userform">
<div class="row cl">
<label class="level level2 form-label col-xs-4 col-sm-2">登录名:</label>
<div class="formControls col-xs-8 col-sm-3">
<input name="username" type="text" autocomplete="off" placeholder="手机号码或者QQ号或者QQ邮箱" maxlength="20"
class="input-text" datatype="/^1[3|4|5|7|8][0-9]{9}$/ | /^[1-9]\d{4,14}$/ | /^[1-9]\d{4,14}@(qq|QQ).com$/" nullmsg="请输入用户名!"
sucmsg="用户名格式正确!" errormsg="手机号码或者QQ号或者QQ邮箱"/>
</div>
<div class="formControls col-xs-8 col-sm-7">
</div>
</div>
<div class="row cl">
<label class="level level2 form-label col-xs-4 col-sm-2">登录密码:</label>
<div class="formControls col-xs-8 col-sm-3">
<input name="password" type="password" class="input-text" autocomplete="off" maxlength="20"
placeholder="请输入6-20,任意字符组合,不包括空格!" class="input-text" datatype="/^[^\s]{6,20}$/"
nullmsg="请输入登录密码!" sucmsg="密码格式正确!" errormsg="格式错误,请输入6-20,任意字符组合,不包括空格!"/>
</div>
<div class="formControls col-xs-8 col-sm-7">
</div>
</div>
<div class="row cl">
<label class="level level2 form-label col-xs-4 col-sm-2">再次输入登录密码:</label>
<div class="formControls col-xs-8 col-sm-3">
<input name="password2" type="password" class="input-text" autocomplete="off" placeholder="请再次输入登录密码!" maxlength="20"
class="input-text" datatype="*" recheck="password" nullmsg="请再次输入登录密码!" sucmsg="密码正确!" errormsg="两次输入密码不匹配!"/>
</div>
<div class="formControls col-xs-8 col-sm-7">
</div>
</div>
<div class="row cl">
<div class="formControls col-xs-8 col-sm-offset-2">
<input class="btn btn-primary radius mr-20" type="submit" value="确认添加">
<input class="btn btn-primary radius" type="button" value="返回" οnclick="backUrl();">
</div>
</div>
</form>
</div>
<script type="text/javascript" src="$staticPath/js/Validform_v5.3.2_min.js"></script>
<script type="text/javascript">
$(function () {
$("#userform").Validform({
tiptype: 2,
callback: function (data) {
var data = $("#userform").serialize();
$.ajax({
type: 'POST',
dataType: "json",
data: data,
url: '$basePath/user/submitAdd',
success: function (data) {
if (data.code == 0) {
layer.confirm('用户添加成功!', {
btn: ['确认'] //按钮
}, function(){
window.location = "$basePath/user/userList";
});
} else {
layer.alert("添加用户失败:"+data.data, {icon: 5});
}
}, error: function (err) {
layer.alert("服务器忙,请稍后再试!", {icon: 5});
}
});
return false;
}
});
});
function backUrl(){
window.location.href="$basePath/user/userList";
}
</script>
#parse("/common/bottom.vm")