<%@ page contentType="text/html;charset=UTF-8" %>
<%@ include file="/WEB-INF/views/include/taglib.jsp"%>
<html>
<head>
	<title>科目管理</title>
	<meta name="decorator" content="default"/>
	<%@include file="/WEB-INF/views/include/head.jsp" %>
</head>
<body>
	<form:form id="inputForm" modelAttribute="subject" action="${ctx}/admin/exam/subject/save" method="post" class="form-horizontal">
		<form:hidden path="code"/>
		<tags:message content="${message}"/>
		<div class="control-group">
			<label class="control-label">名称</label>
			<div class="controls">
				<form:input path="name" htmlEscape="false" maxlength="20" class="required"/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">层次</label>
			<div class="controls">
				<form:input path="level" htmlEscape="false" maxlength="20" class=""/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">专业</label>
			<div class="controls">
				<form:input path="category" htmlEscape="false" maxlength="20" class=""/>
			</div>
		</div>
		<div class="control-group">
			<label class="control-label">备注</label>
			<div class="controls">
				<form:input path="remark" htmlEscape="false" maxlength="20" class=""/>
			</div>
		</div>
		<div class="form-actions">
			<input id="btnSubmit" class="btn btn-primary" type="submit" value="保 存"/>
		</div>
	</form:form>
<script type="text/javascript">
	$(document).ready(function() {
		//$("#name").focus();
		$("#inputForm").validate({
			
			submitHandler: function(form){
				//alert("studentId="+$("#studentId").val()+" subjectCode="+$("#subjectCode").val());
				loading('正在提交，请稍等...');
				form.submit();
			},
			errorContainer: "#messageBox",
			errorPlacement: function(error, element) {
				$("#messageBox").text("输入有误，请先更正。");
				if (element.is(":checkbox")||element.is(":radio")||element.parent().is(".input-append")){
					error.appendTo(element.parent().parent());
				} else {
					error.insertAfter(element);
				}
			}
		});
	});
</script>	
</body>
</html>
