<%
layout("/include/_container.html", {title:"表单", parent:"测试校验"}){
%>
	<script type="text/javascript">

		$(document).ready(function() {
			jp.ajaxForm("#inputForm",function(data){
				if(data.success){
				    jp.toastr_success(data.msg);
				    jp.unblock("#inputForm", 0);//立即清除loading层
					jp.go("${ctx}/test/validation/testValidation");
				}else{
				    jp.toastr_error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			})

	        $('#newDate').datetimepicker({
				 format:'Y-m-d H:i'
		    });
		});
		
	</script>
<div class="white-box">
		<form id="inputForm"  action="${ctx}/test/validation/testValidation/save" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${testValidation.id!}"/>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>浮点数字：</label>
					<div class="col-sm-10">
						<input name="num" value="${testValidation.num!}"   max="69.3"  min="20.1" class="jp-input required number"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>整数：</label>
					<div class="col-sm-10">
						<input name="num2" value="${testValidation.num2!}"   max="30"  min="10" class="jp-input required digits"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>字符串：</label>
					<div class="col-sm-10">
						<input name="str" value="${testValidation.str!}" maxlength="65"  minlength="5"   class="jp-input required"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>邮件：</label>
					<div class="col-sm-10">
						<input name="email" value="${testValidation.email!}" maxlength="60"  minlength="10"   class="jp-input required email"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>网址：</label>
					<div class="col-sm-10">
						<input name="url" value="${testValidation.url!}" maxlength="30"  minlength="10"   class="jp-input required url"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>日期：</label>
					<div class="col-sm-10">
			             <span class="jp-calendar-picker">
								<input readonly=""  id="newDate" name="newDate"  placeholder="请选择日期" class="jp-calendar-picker-input jp-input   required"   value="${fn.formatDate(testValidation.newDate!, 'yyyy-MM-dd HH:mm:ss')}">
								<span class="jp-calendar-picker-icon"></span>
						</span>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>备注信息：</label>
					<div class="col-sm-10">
						<textarea name="remarks" rows="4"    class="jp-input required">${testValidation.remarks!}</textarea>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>浮点数小于等于0：</label>
					<div class="col-sm-10">
						<input name="c1" value="${testValidation.c1!}"    class="jp-input required isFloatLteZero"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>身份证号码：</label>
					<div class="col-sm-10">
						<input name="c2" value="${testValidation.c2!}"    class="jp-input required isIdCardNo"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>QQ号码：</label>
					<div class="col-sm-10">
						<input name="c3" value="${testValidation.c3!}"    class="jp-input required isQq"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>手机号码：</label>
					<div class="col-sm-10">
						<input name="c4" value="${testValidation.c4!}"    class="jp-input required isMobile"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>中英文数字下划线：</label>
					<div class="col-sm-10">
						<input name="c5" value="${testValidation.c5!}"    class="jp-input required stringCheck"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>合法字符(a-z A-Z 0-9)：</label>
					<div class="col-sm-10">
						<input name="c6" value="${testValidation.c6!}"    class="jp-input required isRightfulString"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">英语：</label>
					<div class="col-sm-10">
						<input name="en" value="${testValidation.en!}"    class="jp-input  isEnglish"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">汉子：</label>
					<div class="col-sm-10">
						<input name="zn" value="${testValidation.zn!}"    class="jp-input  isChinese"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">汉英字符：</label>
					<div class="col-sm-10">
						<input name="enzn" value="${testValidation.enzn!}"    class="jp-input  isChineseChar"/>
					</div>
				</div>
		<% if(mode == "add" || mode == "edit"){ %>
		<div class="form-group">
				<div class="col-lg-3"></div>
		        <div class="col-lg-6">
		             <button class="jp-btn jp-btn-primary jp-btn-lg  btn-block btn-lg btn-parsley" data-loading-text="正在提交...">提 交</button>
		        </div>
		</div>
		<% } %>
		</form>
</div>
<% } %>