|
@@ -19,29 +19,63 @@
|
|
|
<%@include file="../cssforpr.css" %>
|
|
|
<%@include file="../bootstrap.min.css" %>
|
|
|
</style>
|
|
|
-</head>
|
|
|
-<script type="text/javascript" charset="utf-8">
|
|
|
- $("select#groupId").change(function(){
|
|
|
- $.getJSON("/loadStudents",{groupId: $(this).val()}, function(j){
|
|
|
- var options = '';
|
|
|
- for (var i = 0; i < j.length; i++) {
|
|
|
- options += '<option value="' + j[i].stFamily + '">' + j[i].stFamily + '</option>';
|
|
|
- }
|
|
|
- $("select#studentId").html(options);
|
|
|
- });
|
|
|
- });
|
|
|
+ <script type="text/javascript"
|
|
|
+ src="<c:url value='/WEB-INF/lib/jquery-3.1.1.min.js' />"></script>
|
|
|
|
|
|
- $("select#groupId").change(function(){
|
|
|
- $.getJSON("/loadStudents",{groupId: $(this).val()}, function(j){
|
|
|
- var options = '';
|
|
|
- for (var i = 0; i < j.length; i++) {
|
|
|
- options += '<option value="' + j[i].stFamily + '">' + j[i].stFamily + '</option>';
|
|
|
- }
|
|
|
- $("select#studentId").html(options);
|
|
|
+ <c:url var="getGroups" value="/loadGroups" />
|
|
|
+ <script type="text/javascript">
|
|
|
+ $(document).ready(
|
|
|
+ function() {
|
|
|
+ $.getJSON('${getGroups}', {
|
|
|
+ ajax : 'true'
|
|
|
+ }, function(data) {
|
|
|
+ var html = '<option value="">Выберите группу</option>';
|
|
|
+ var len = data.length;
|
|
|
+ for ( var i = 0; i < len; i++) {
|
|
|
+ html += '<option value="' + data[i].groupId + '">'
|
|
|
+ + data[i].groupName + '</option>';
|
|
|
+ }
|
|
|
+ html += '</option>';
|
|
|
+ $('select#IdGroupPart').html(html);
|
|
|
+ });
|
|
|
+ });
|
|
|
+ </script>
|
|
|
+
|
|
|
+ <c:url var="getStudents" value="/loadStudents" />
|
|
|
+ <script type="text/javascript">
|
|
|
+ $(document).ready(function() {
|
|
|
+ $('#IdGroupPart').change(
|
|
|
+ function() {
|
|
|
+ $.getJSON('${getStudents}', {
|
|
|
+ groupId : $(this).val(),
|
|
|
+ ajax : 'true'
|
|
|
+ }, function(data) {
|
|
|
+ var html = '<option value="">Выберите студента</option>';
|
|
|
+ var len = data.length;
|
|
|
+ for ( var i = 0; i < len; i++) {
|
|
|
+ html += '<option value="' + data[i].studentsId + '">'
|
|
|
+ + data[i].stFamily + '</option>';
|
|
|
+ }
|
|
|
+ html += '</option>';
|
|
|
+ $('#IdStudentPart').html(html);
|
|
|
+ });
|
|
|
+ });
|
|
|
});
|
|
|
- });
|
|
|
</script>
|
|
|
-
|
|
|
+ <script type="text/javascript">
|
|
|
+ $(document).ready(function(){
|
|
|
+ $("#IdStudentPart").change(onSelectChange);
|
|
|
+ });
|
|
|
+ function onSelectChange() {
|
|
|
+ var selected = $("#IdStudentPart option:selected");
|
|
|
+ var output = "";
|
|
|
+ if(selected.val() != 0){
|
|
|
+ output = "Вы выбрали студента " + selected.text();
|
|
|
+ }
|
|
|
+ $("#output").html(output);
|
|
|
+ }
|
|
|
+ </script>
|
|
|
+</head>
|
|
|
<body>
|
|
|
|
|
|
<div class="inner">
|
|
@@ -58,15 +92,16 @@
|
|
|
<div class="login-block">
|
|
|
|
|
|
<h1>Вход как Исполнитель</h1>
|
|
|
- <form:form method="post" modelAttribute="studentLogin" action="checkStudent">
|
|
|
- <form:select id="groupId" path="">
|
|
|
- <c:forEach items="${groupList}" var="group">
|
|
|
- <form:option value="${group.groupId}" >${group.groupName}</form:option>
|
|
|
- </c:forEach><br/>
|
|
|
+ <div id="output"></div>
|
|
|
+ <c:url value="checkStudent" var="checkStudentUrl" />
|
|
|
+ <form:form id="signUp" method="post" modelAttribute="studentLogin" action="${checkStudentUrl}">
|
|
|
+ <fieldset>
|
|
|
+ <form:select id="IdGroupPart" path="">
|
|
|
</form:select>
|
|
|
- <form:select id="studentId" path="name">
|
|
|
- <form:option value="${group.groupId}" >${group.groupName}</form:option>
|
|
|
+ <form:select id="IdStudentPart" path="name">
|
|
|
+ <form:option value="">Выберите студента</form:option>
|
|
|
</form:select>
|
|
|
+ </fieldset>
|
|
|
<form:input path="password" type="password" value="" placeholder="Пароль" id="password"/>${passMessage}<br/>
|
|
|
<form:button>Войти</form:button>
|
|
|
</form:form>
|