zoukankan      html  css  js  c++  java
  • 20201130千锤百炼软工人

    这是昨天其他页面的完善

    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>删除学生信息</title>
    </head>
        <%
             Object message = request.getAttribute("message");
             if(message!=null && !"".equals(message)){
         
        %>
             <script type="text/javascript">
                  alert("<%=request.getAttribute("message")%>");
             </script>
        <%} %>
    <body>
        <form action="deleteServlet" method="post">
        <div align="center">
            <h1 style="color: black;">&nbsp&nbsp&nbsp欢迎进行学生信息删除!</h1>
            <a href="menu.jsp"><div style="color: black;">返回主页</div></a>
               <br>
            <table border="6">
                <tr>
                    <td><h4><div style="color: black;">姓名:</div></h4></td>
                    <td><input type="text" name="name" required maxlength="4" placeholder="请输入姓名"/></td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                    <button type="submit">提&nbsp&nbsp&nbsp交</button>
                    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                    <button type="reset">清&nbsp&nbsp&nbsp空</button>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </body>
    </html>

     <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>查找学生信息</title>
    </head>
        <%
             Object message = request.getAttribute("message");
             if(message!=null && !"".equals(message)){
         
        %>
             <script type="text/javascript">
                  alert("<%=request.getAttribute("message")%>");
             </script>
        <%} %>
    <body>
        <form action="searchServlet" method="post">
        <div align="center">
            <h1 style="color: black;">&nbsp&nbsp&nbsp欢迎进行学生信息查找!</h1>
            <a href="menu.jsp"><div style="color: black;">返回主页</div></a>
               <br>
            <table border="6">
                <tr>
                    <td><h4><div style="color: black;">姓名:</div></h4></td>
                    <td><input type="text" name="name" maxlength="4" placeholder="请输入姓名"/></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">身份证号:</div></h4></td>
                    <td><input type="text" name="idc" id="idc" maxlength="18" onblur="checkIdc(this.value)" placeholder="请输入身份证号"><span id="span1"></span></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">出生年月:</div></h4></td>
                    <td><input type="number" name="birthday" id="birthday" placeholder="请输入出生年月" onblur="checkBirthday(this.value)" ><span id="span3"></span></td>
                </tr>
                </tr>
                <tr>
                    <td></td>
                    <td>
                    <button type="submit">提&nbsp&nbsp&nbsp交</button>
                    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                    <button type="reset">清&nbsp&nbsp&nbsp空</button>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </body>
    <script type="text/javascript">
    function checkIdc(str){
        var idc = document.getElementById("idc").value;
        var sp = document.getElementById("span1");
        var re = /(^d{15}$)|(^d{18}$)|(^d{17}(d|X|x)$)/;
        if (re.test(str)) {
            sp.innerHTML = "格式正确"
        } else {
        sp.innerHTML = "输入格式有误"
        }
        }
    function checkBirthday(str){
        var birthday = document.getElementById("birthday").value;
        var sp = document.getElementById("span3");
        var re = /^((19|20)[0-9]{2})((0[1-9])|(1[0-2]))((0[1-9])|((1|2)[0-9])|(3[0-1]))$/;
        if (re.test(str)) {
            sp.innerHTML = "格式正确"
        } else {
        sp.innerHTML = "输入格式有误"
        }
        }
    </script>
    </html>

    <%@ page language="java" contentType="text/html; charset=utf-8"
        pageEncoding="utf-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="utf-8">
    <title>添加学生信息</title>
    </head>
        <%
            String id = request.getParameter("id");
        %>
        <%
             Object message = request.getAttribute("message");
             if(message!=null && !"".equals(message)){
         
        %>
             <script type="text/javascript">
                  alert("<%=request.getAttribute("message")%>");
             </script>
        <%} %>
    <body>
        <form action="updateServlet?id=<%=id%>" method="post">
        <div align="center">
            <h1 style="color: black;">&nbsp&nbsp&nbsp欢迎进行学生信息修改!</h1>
            <a href="menu.jsp"><div style="color: black;">返回主页</div></a>
            <br>
            <table border="6">
                <tr>
                    <td><h4><div style="color: black;">姓名:</div></h4></td>
                    <td><input type="text" name="name" required maxlength="4" placeholder="请输入姓名"/></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">身份证号:</div></h4></td>
                    <td><input type="text" name="idc" id="idc" required maxlength="18" onblur="checkIdc(this.value)" placeholder="请输入身份证号"><span id="span1"></span></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">籍贯:</div></h4></td>
                    <td><input type="text" name="born" required placeholder="请输入籍贯"/></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">电话:</div></h4></td>
                    <td><input type="number" name="phone" id="phone" required  placeholder="请输入电话" onblur="checkPhone(this.value)" ><span id="span2"></span></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">出生年月:</div></h4></td>
                    <td><input type="number" name="birthday" id="birthday"required  placeholder="请输入出生年月" onblur="checkBirthday(this.value)" ><span id="span3"></span></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">专业:</div></h4></td>
                    <td><input type="text" name="major" required  placeholder="请输入专业"/></td>
                </tr>
                <tr>
                    <td><h4><div style="color: black;">备注:</div></h4></td>
                    <td><textarea cols="30" rows="5" name="beizhu">
                        </textarea>
                    </td>
                </tr>
                <tr>
                    <td></td>
                    <td>
                    <button type="submit">提&nbsp&nbsp&nbsp交</button>
                    &nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp&nbsp
                    <button type="reset">清&nbsp&nbsp&nbsp空</button>
                    </td>
                </tr>
            </table>
        </div>
        </form>
    </body>
    <script type="text/javascript">
    function checkIdc(str){
        var idc = document.getElementById("idc").value;
        var sp = document.getElementById("span1");
        var re = /(^d{15}$)|(^d{18}$)|(^d{17}(d|X|x)$)/;
        if (re.test(str)) {
            sp.innerHTML = "格式正确"
        } else {
        sp.innerHTML = "输入格式有误"
        }
        }
    function checkPhone(str){
        var phone = document.getElementById("phone").value;
        var sp = document.getElementById("span2");
        var re = /^([1]d{10}|([((]?0[0-9]{2,3}[))]?[-]?)?([2-9][0-9]{6,7})+(-[0-9]{1,4})?)$/;
        if (re.test(str)) {
            sp.innerHTML = "格式正确"
        } else {
        sp.innerHTML = "输入格式有误"
        }
        }
    function checkBirthday(str){
        var birthday = document.getElementById("birthday").value;
        var sp = document.getElementById("span3");
        var re = /^((19|20)[0-9]{2})((0[1-9])|(1[0-2]))((0[1-9])|((1|2)[0-9])|(3[0-1]))$/;
        if (re.test(str)) {
            sp.innerHTML = "格式正确"
        } else {
        sp.innerHTML = "输入格式有误"
        }
        }

    </script>
    </html>

  • 相关阅读:
    Web用户的身份验证及WebApi权限验证流程的设计和实现
    开源工作流引擎CCFlow 学习专区
    Jquery Ajax方法传值到action
    再谈Jquery Ajax方法传递到action
    Windows下安装GTK+
    Tex使用
    配置Texmaker中文支持
    软件推荐列表(Recommand Software)
    CAD操作
    Package inputenc Error: Unicode char u8: not set up for use with LaTeX.
  • 原文地址:https://www.cnblogs.com/huangmouren233/p/14143920.html
Copyright © 2011-2022 走看看