摘要:基于的学生宿舍管理系统部分代码实现楼栋不能为空编辑表单提交之前进行检查,如果,则不允许提交根据获取值姓名不能为空电话不能为空侧边栏
基于javaweb+jsp的学生宿舍管理系统
JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven …
部分代码实现JSP
return false; } if (document.getElementById("add-administratorBuilding").value.trim().length == 0) { alert("楼栋不能为空"); return false; } return true; } //编辑表单提交之前进行检查,如果return false,则不允许提交 function editCheck() { //根据ID获取值 if (document.getElementById("edit-administratorName").value.trim().length == 0) { alert("姓名不能为空"); return false; } if (document.getElementById("edit-administratorPhone").value.trim().length == 0) { alert("电话不能为空"); return false; }
<div class="row"> <div class="col-sm-3 col-md-2 sidebar"> <jsp:include page="menu.jsp"> <jsp:param value="active" name="Administrator_active"/> jsp:include> div> <br> <div class="col-sm-9 col-sm-offset-3 col-md-10 col-md-offset-2 main"> <div class="row"> <div class="col-sm-7"> <div class="input-group"> <input class="form-control" type="hidden" id="searchColumn" name="searchColumn" value="administrator_name"/> <input class="form-control" type="text" id="search_keyword" name="search_keyword" placeholder="姓名"/> <span class="input-group-btn"><button class="btn btn-line btn-danger" type="button" onclick="searchList()">搜索button>span> div> div> <div class="col-sm-5"> <button type="button" if test="${loginUser.userType != "管理员"}">disabled="disabled" title="没有权限!!!"c:if> class="btn btn-line btn-primary" data-toggle="modal" data-target="#modal-add">添加宿管员 button> div> div>
<br> <div class="table-responsive"> <table class="table table-striped table-hover"> <thead> <tr> <th>姓名th> <th>性别th> <th>电话th> <th>楼栋th> <th style="text-align: center;">操作th> tr> thead> <tbody> <c:forEach items="${list}" var="vo"> <tr> <td>${vo.administratorName}td> <td>${vo.administratorSex}td> <td>${vo.administratorPhone}td> <td>${vo.administratorBuilding}td>
<nav class="navbar navbar-inverse navbar-fixed-top"> <div class="container-fluid"> <div class="navbar-header"> <button type="button" class="navbar-toggle collapsed" data-toggle="collapse" data-target="#navbar" aria-expanded="false" aria-controls="navbar"> <span class="sr-only">学生宿舍管理系统span> <span class="icon-bar">span> <span class="icon-bar">span> <span class="icon-bar">span> button> <a class="navbar-brand" href="#">学生宿舍管理系统a> div> <div id="navbar" class="navbar-collapse collapse"> <ul class="nav navbar-nav navbar-right"> <li><a href="#">欢迎:<span style="color: yellow">${loginUser.username}span>a>li> <li><a href="authLogout">退出a>li> ul> div> div>nav>
<%@ page contentType="text/html; charset=utf-8" pageEncoding="utf-8" %><%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c" %><%@ taglib prefix="fn" uri="http://java.sun.com/jsp/jstl/functions" %><%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>DOCTYPE html><html><head> <meta charset="UTF-8"> <title>宿管员 管理title> <link rel="stylesheet" href="css/bootstrap.css"> <link rel="stylesheet" href="css/main.css"> <script src="js/jquery-3.5.1.js">script> <script src="js/bootstrap.js">script>head>
let id = button.data("id"); let modal = $(this); modal.find("#delete-id").val(id); }) $("#modal-edit").on("show.bs.modal", function (event) { let button = $(event.relatedTarget); let id = button.data("id"); let modal = $(this); $.ajax({ url: "administratorGet?id=" + id, type: "get", success: function (voString) { let vo = eval("(" + voString + ")"); modal.find("#edit-id").val(vo.id); modal.find("#edit-administratorName").val(vo.administratorName); for (let val of "男/女".split("/")) { if (val == vo.administratorSex) { modal.find("#edit-administratorSex_" + vo.administratorSex).prop("checked", true); } else { modal.find("#edit-administratorSex_" + vo.administratorSex).removeAttr("checked");
<span aria-hidden="true">×span> button> <h4 class="modal-title">宿管员 h4> div> <div class="modal-body"> <table class="table table-striped table-hover" style="font-size: 15px;"> <tr> <td style="width: 15%;">姓名:td> <td><b id="info-administratorName">b>td> tr> <tr> <td style="width: 15%;">性别:td> <td><b id="info-administratorSex">b>td> tr> <tr> <td style="width: 15%;">电话:td>
<label for="add-administratorText" class="control-label">备注:label> <textarea style="height: 100px;" class="form-control" name="administratorText" id="add-administratorText">textarea> div> div> <div class="modal-footer"> <button type="button" class="btn btn-line btn-warning" data-dismiss="modal">取消button> <button type="submit" class="btn btn-line btn-primary">提交button> div> form> div> div>div><div class="modal fade" id="modal-info" tabindex="-1" role="dialog" aria-labelledby="myModalLabel"> <div class="modal-dialog" role="document"> <div class="modal-content"> <form> <div class="modal-header">
modal.find("#info-administratorBuilding").text(vo.administratorBuilding); modal.find("#info-administratorText").text(vo.administratorText); } }) }) function searchList() { window.location.href = "administratorList?searchColumn="+document.getElementById("searchColumn").value+"&keyword=" + document.getElementById("search_keyword").value; } //增加表单提交之前进行检查,如果return false,则不允许提交 function addCheck() { //根据ID获取值 if (document.getElementById("add-administratorName").value.trim().length == 0) { alert("姓名不能为空"); return false; } if (document.getElementById("add-administratorPhone").value.trim().length == 0) {
div> <div class="modal-footer"> <button type="button" class="btn btn-line btn-warning" data-dismiss="modal">取消button> <button type="submit" class="btn btn-line btn-default">删除button> div> form> div> div>div>body><script> $("#modal-delete").on("show.bs.modal", function (event) {
tr> <tr> <td style="width: 15%;">楼栋:td> <td><b id="info-administratorBuilding">b>td> tr> <tr> <td style="width: 15%;">备注:td> <td><b id="info-administratorText">b>td> tr> table> <br> div> <div class="modal-footer"> <button type="button" class="btn btn-line btn-warning" data-dismiss="modal">关闭button> div> form> div> div>div>
<button class="btn btn-line btn-info btn-sm" data-id="${vo.id}" data-toggle="modal" data-target="#modal-info">详情 button> <button class="btn btn-line btn-warning btn-sm" if test="${loginUser.userType != "管理员"}">disabled="disabled" title="没有权限!!!"c:if> data-id="${vo.id}"
文章版权归作者所有,未经允许请勿转载,若此文章存在违规行为,您可以联系管理员删除。
转载请注明本文地址:https://www.ucloud.cn/yun/124445.html
基于javaweb+jsp的学生成绩管理系统 JavaWeb JavaBean JSP MVC MySQL Tomcat JavaScript idea eclipse MyEclipse Servlet SSM Maven … 部分代码实现JSP let editIndex = layedit.build('LAY_demo_editor'); ...
摘要:项目介绍本系统采用框架,数据层采用,数据库使用,可以用作毕业设计课程设计等,适合选题高校宿舍宿舍员工宿舍等,下面是大概的功能,具体功能实现可以建议看下方的演示视频,系统适合于基础一般的同学使用。 项目介绍: 本系统采用SSM框架,数据层采用mybatis,数据库使用mysql,可以用作毕业设...
摘要:运行结果数据库的个表表表一定要导入数据库用的包,以及在在文件夹中导入数据库包文件目录结构具体代码首页欢迎进入选课系统欢迎进入选课系统学生登录学生注册管理员登录学生登录学生登录学生登录学号密码登录注册返回学生注册注册 运行结果: showImg(https://segmentfault.com/img/bVbthFj); showImg(https://segmentfault.com/...
阅读 3273·2021-11-23 09:51
阅读 938·2021-09-03 10:30
阅读 3210·2021-08-31 09:40
阅读 3276·2019-08-30 14:22
阅读 900·2019-08-30 14:09
阅读 2898·2019-08-30 13:21
阅读 3230·2019-08-28 18:03
阅读 2858·2019-08-26 13:44