zoukankan      html  css  js  c++  java
  • JAVA日报

    用户管理系统开发(修改)

    点击用户信息显示页面的连接后跳转到此页面  将上一页面信息只读显示传递到servlet  根据用户名  和用户修改项进行修改

    <%@ page language="java" contentType="text/html; charset=UTF-8"
    pageEncoding="UTF-8"%>
    <!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>Insert title here</title>
    <%
    request.setCharacterEncoding("utf-8");
    response.setCharacterEncoding("utf-8");
    response.setContentType("text/html; charset=utf-8");
    String id=request.getParameter("UserID");
    String UserName=request.getParameter("UserName");
    String sex=request.getParameter("sex");
    String idNumber=request.getParameter("idNumber");
    String Phone=request.getParameter("Phone");
    String User=request.getParameter("User");
    String Password=request.getParameter("Password");

    %>
    </head>
    <body>
    <div style="position:absolute;100%;height:100%;background:#7FDBFF;">
    <h1>修改信息</h1>
    <form action="UserServlet?method=gai" method="post">
    <table>
    <td>id:</td>
    <td><input type="text" name="UserID"id="UserID" style="400px;height:30px" value="<%=id %>" readonly="readonly"><br></td>
    <tr>
    <td>用户姓名:</td>
    <td><input type="text" name="UserName" style="400px;height:30px" value="<%=UserName %>" readonly="readonly"><br></td>
    </tr>
    <tr>
    <td>性别:</td>
    <td><input type="text" name="sex" style="400px;height:30px" value="<%=sex %>" readonly="readonly"><br></td>
    </tr>
    <tr>
    <td>身份证号:</td>
    <td><input type="text" name="idNumber" style="400px;height:30px" value="<%=idNumber %>" readonly="readonly"><br></td>
    </tr>
    <tr>
    <td>手机号:</td>
    <td><input type="text" name="Phone" style="400px;height:30px" value="<%=Phone %>" readonly="readonly"><br></td>
    </tr>
    <tr>
    <td>家庭住址:</td>
    <td><input type="text" name="User" style="400px;height:30px" value="<%=User %>" readonly="readonly"><br></td>
    </tr>
    <tr>
    <td>密码:</td>
    <td><input type="text" name="Password" style="400px;height:30px" value="<%=Password %>" readonly="readonly"><br></td>
    </tr>
    <tr>
    <td>修改项:
    <select name="role">
    <option value="UserName">用户姓名</option>
    <option value="sex">性别</option>
    <option value="idNumber">身份证号</option>
    <option value="Phone">手机号</option>
    <option value="User">家庭住址</option>
    <option value="Password">密码</option>
    </select>
    </td>
    <td>
    <input type="text" name="id1"style="400px;height:30px" value="" >
    </td>
    </tr>
    <tr>
    <td><button type="submit" onclick="return check()">提交</button></td>
    <td><button type="button" onclick="history.back(-1)">返回</button></td>
    </tr>
    </table>
    </form>
    </div>
    </body>
    <script type="text/javascript">
    function check() //封装一个<body>中做成点击事件的函数
    {
    if(document.getElementById('UserID').value=='') {
    alert('不能为空!');
    return false;
    }else {return true;}
    }
    </script>
    </html>

  • 相关阅读:
    Luogu 1080 【NOIP2012】国王游戏 (贪心,高精度)
    Luogu 1314 【NOIP2011】聪明的质检员 (二分)
    Luogu 1315 【NOIP2011】观光公交 (贪心)
    Luogu 1312 【NOIP2011】玛雅游戏 (搜索)
    Luogu 1525 【NOIP2010】关押罪犯 (贪心,并查集)
    Luogu 1514 引水入城 (搜索,动态规划)
    UVA 1394 And Then There Was One / Gym 101415A And Then There Was One / UVAlive 3882 And Then There Was One / POJ 3517 And Then There Was One / Aizu 1275 And Then There Was One (动态规划,思维题)
    Luogu 1437 [HNOI2004]敲砖块 (动态规划)
    Luogu 1941 【NOIP2014】飞扬的小鸟 (动态规划)
    HDU 1176 免费馅饼 (动态规划)
  • 原文地址:https://www.cnblogs.com/mumulailai/p/14906059.html
Copyright © 2011-2022 走看看