1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950 |
- <%--suppress JSUnresolvedFunction --%>
- <%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
- <%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
- <%--suppress ALL --%>
- <%--
- Created by IntelliJ IDEA.
- User: Кинетик
- Date: 28.12.2016
- Time: 20:07
- To change this template use File | Settings | File Templates.
- --%>
- <%@page contentType="text/html" pageEncoding="UTF-8"%>
- <!DOCTYPE html>
- <html>
- <head>
- <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
- <title>JSP Page</title>
- <script src="http://code.jquery.com/jquery-1.10.1.min.js"></script>
- <script src="http://code.jquery.com/jquery-latest.min.js"></script>
- </head>
- <c:url var="loadStudentsByGroup" value="/loadStudents" />
- <script type="text/javascript">
- $(document).ready(function() {
- $('#groupId').change(
- function() {
- $.getJSON('${loadStudentsByGroup}', {
- groupId : $(this).value(),
- ajax : 'true'
- }, function(data) {
- var html = '<option value="">Первый элемент</option>';
- $('#studentId').html(html);
- });
- });
- });
- </script>
- <body>
- <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/>
- </form:select>
- <form:select id="studentId" path="name">
- </form:select>
- </form:form>
- </body>
- </html>
|