<%
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/manytomany/studentCourse");
				}else{
				    jp.toastr_error(data.msg);
				    $("#inputForm").find("button:submit").button("reset");
				}
			})

		});
		
	</script>
<div class="white-box">
		<form id="inputForm"  action="${ctx}/test/manytomany/studentCourse/save" method="post" class="form-horizontal">
		<input type="hidden" name="id" value="${studentCourse.id!}"/>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>学生：</label>
					<div class="col-sm-10">
						<#gridselect url="${ctx}/test/manytomany/student/data" id="student" name="student.id" value="${studentCourse.student.id!}" labelName="student.name" labelValue="${studentCourse.student.name!}"
							 title="选择学生" class="jp-input required" fieldLabels="姓名" fieldKeys="name" searchLabels="姓名" searchKeys="name" />
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label"><font color="red">*</font>课程：</label>
					<div class="col-sm-10">
						<#gridselect url="${ctx}/test/manytomany/course/data" id="course" name="course.id" value="${studentCourse.course.id!}" labelName="course.name" labelValue="${studentCourse.course.name!}"
							 title="选择课程" class="jp-input required" fieldLabels="课程名" fieldKeys="name" searchLabels="课程名" searchKeys="name" />
					</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="score" value="${studentCourse.score!}"    class="jp-input required number"/>
					</div>
				</div>
				<div class="form-group">
					<label class="col-sm-2 control-label">备注信息：</label>
					<div class="col-sm-10">
						<textarea name="remarks" rows="4"    class="jp-input ">${studentCourse.remarks!}</textarea>
					</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>
<% } %>