<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/webpage/include/taglib.jsp"%>
<html>
<head>
	<title>个人信息</title>
	<meta name="decorator" content="default"/>
    <style>
        .help-inline{
            color: red;
            font-size: 12px;
        }
		.form-top{
			padding-top: 40px;
			margin-left: 15px;
			margin-right: 15px;
		}
    </style>
</head>
<body>
<%--<div class="single-form">--%>
	<div class="container1">
	<form:form id="inputForm" modelAttribute="user" action="${ctx}/sys/user/infoEdit"  method="post" class="form-horizontal form-group">

		<div class="form-top">
			<%--<div class="form-group-label"><h2>个人信息</h2></div>--%>
			<div class="layui-item layui-col-sm12">
				<label class="layui-form-label">姓名：</label>
				<div class="layui-input-block">
					<form:input path="name" readonly="true" htmlEscape="false"  maxlength="50"  class="form-control layui-input required" />
				</div>
			</div>
			<div class="layui-item layui-col-sm12">
				<label class="layui-form-label">邮箱：</label>
				<div class="layui-input-block">
					<form:input path="email"  id="email" htmlEscape="false" maxlength="50" class="form-control layui-input email"/>
                    <span class="help-inline"></span>
                </div>
			</div>

			<div class="layui-item layui-col-sm12">
				<label class="layui-form-label">手机：</label>
				<div class="layui-input-block">
					<form:input path="mobile" readonly="true" class="form-control layui-input required" htmlEscape="false" maxlength="50"/>
				</div>
			</div>
<%--			<div class="layui-item layui-col-sm12 with-textarea">--%>
<%--				<label class="layui-form-label">备注：</label>--%>
<%--				<div class="layui-input-block">--%>
<%--					<form:textarea  placeholder="请输入备注信息" path="remarks" htmlEscape="false" style="resize:none;" rows="4" maxlength="200" class="form-control "/>--%>
<%--				</div>--%>
<%--			</div>--%>

		<script type="text/javascript">
            $('#email').blur(function (){
                if($('#email').val()==null||$('#email').val()=="") {
                    /*$('#email').next("span").html("邮箱不能为空");
                    $('#email').focus();*/
                }else{
					var testEmail = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
                    if(!testEmail.test($('#email').val())){
                        $('#email').next("span").html("邮箱格式不正确");
                        $('#email').focus();
					}else{
                        $('#email').next("span").html("");
                    }
				}
            });
            $('#phone').blur(function (){
                if($('#phone').val()==null||$('#phone').val()=="") {
                    /*$('#phone').next("span").html("电话不能为空");
                    $('#phone').focus();*/
                }else{
					var phone = /^0\d{2,3}-?\d{7,8}$|^1[3|5|8]\d{9}$/;
                    if(!phone.test($('#phone').val())){
                        $('#phone').next("span").html("电话号码格式不正确");
                    }else{
                        $('#phone').next("span").html("");
					}
				}
            });
		</script>
	</form:form>
	</div>
<%--</div>--%>
</body>
</html>