zoukankan      html  css  js  c++  java
  • 人口普查-添加人口信息界面

    添加界面

    <%@ page language="java" contentType="text/html; charset=UTF-8"
        pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>
    <head>
    <meta charset="UTF-8">
    <title>添加</title>
    </head>
    <body>
        <%
            Object message = request.getAttribute("message");
            if (message != null && !"".equals(message)) {
        %>
        <script type="text/javascript">
                  alert("<%=request.getAttribute("message")%>"); //弹出对话框
        </script>
        <%
            }
        %>
        <div align="center">
            <h1>添加信息</h1>
            <a href="index.jsp">返回主页</a>
           
      <form action="servlet?method=insert" method="post">
          <table id="addTable" class="table table-bordered  ">
           <tr class="text-center row">
                   <tr> 
                      <td class="col-sm-2">
                        id
                      </td>
                      <td class="col-sm-4">
                       <input type="text" class="form-control"  name="id" id="id" >
                      </td>
                  <tr class="text-center row">
                    <td class="col-sm-2">
                      户别
                    </td>
                    <td class="col-sm-4">
                      <input type="radio"  name="hubie" id="hubie" value="家庭户">家庭户
                      <input type="radio"  name="hubie" id="hubie" value="集体户">集体户
                    </td></tr>
                    <tr>
                    <td class="col-sm-2">
                      住房类型
                    </td>
                    <td class="col-sm-4">
                              <input type="radio"  name="livetype" id="livetype" value="家庭住宅">家庭住宅
                              <input type="radio"  name="livetype" id="livetype" value="集体住所">集体住所
                            </td><tr><td> </td><td> 
                              <input type="radio"  name="livetype" id="livetype" value="工作地住所">工作地住所
                              <input type="radio"  name="livetype" id="livetype" value="其他住宅">其他住宅
                              <input type="radio"  name="livetype" id="livetype" value="无住宅">无住宅
                    </td>
                  </tr>
    
                  <tr class="text-center row">
                    <td class="col-sm-2">
                      本户现住房面积:
                    </td>
                    <td class="col-sm-4">
                      <input type="text" class="form-control"  name="area" id="area" placeholder="请输入数字(平方米)">
                    </td>
                    </tr>
                    <tr>
                    <td class="col-sm-2 ">
                      本户现住房间数:
                    </td>
                    <td class="col-sm-4">
                      <input type="text" class="form-control"  name="roomnum" id="roomnum" placeholder="请输入数字(间)">
                    </td>
                  </tr>
    
                  <tr class="text-center row">
                    <td class="col-sm-2">
                      户主姓名
                    </td>
                    <td class="col-sm-4">
                      <input type="text" class="form-control"  name="name" id="name" placeholder="请输入户主姓名">
                    </td>
                     </tr>
    
                  <tr class="text-center row">
                    <td class="col-sm-2 ">
                      身份证号码
                    </td>
                    <td class="col-sm-4">
                      <input type="text" class="form-control"  name="idcard" id="idcard" placeholder="请输入身份证号码">
                    </td>
                  </tr>
    
                  <tr class="text-center row">
                    <td class="col-sm-2">
                      性别
                    </td>
                    <td class="col-sm-4">
                      <input type="radio"  name="sex" id="sex" value="男">男
                      <input type="radio"  name="sex" id="sex" value="女">女
                    </td>
                     </tr>
    
                  <tr class="text-center row">
                    <td class="col-sm-2">
                      民族
                    </td>
                    <td class="col-sm-4">
                      <input type="text" class="form-control"  name="nation" id="nation" placeholder="民族">
                    </td>
                  </tr>
    
                  <tr class="text-center row">
                    <td>
                      受教育程度
                    </td>
                    <td colspan="3">
                      <select class="form-control" id="education" name="education">
                        <option value="研究生">研究生</option>
                        <option value="大学本科">大学本科</option>
                        <option value="大学专科">大学专科</option>
                        <option value="高中">高中</option>
                        <option value="初中">初中</option>
                        <option value="小学">小学</option>
                        <option value="未上过学">未上过学</option>
                      </select>
                    </td>
                  </tr>
                </table>
                <input type="submit" value="添加"  onclick= "return check()" /> 
          </form> 
        </div>
    </body>
    <script type="text/javascript">
            function check()                        //封装一个<body>中做成点击事件的函数
            {
            	if(document.getElementById('area').value=='') {
            		  alert('现住房面积不能为空!');
            		  document.getElementById('area').focus();
            		  return false;
            		 }
            	else if(document.getElementById('area').value%1!=0){
            		alert('住房面积不是整数!');
            		return false;
            	}
            	if(document.getElementById('roomnum').value=='') {
          		  alert('现住房间数不能为空!');
          		  document.getElementById('roomnum').focus();
          		  return false;
          		 }
            	else if(document.getElementById('roomnum').value%1!=0){
            		alert('现住房间数不是整数!');
            		return false;
            	}
            	if(document.getElementById('name').value=='') {
          		  alert('户主姓名不能为空!');
          		  document.getElementById('name').focus();
          		  return false;
          		 }
            	
            	if(document.getElementById('idcard').value.length!=18) {
          		  alert('身份证号码位数错误!');
          		  document.getElementById('idcard').focus();
          		  return false;
          		 }
            	if(document.getElementById('nation').value=='') {
          		  alert('民族不能为空!');
          		  document.getElementById('nation').focus();
          		  return false;
          		 }
            }
            
        </script>
    </html>
  • 相关阅读:
    Spark Streaming 中管理 Kafka Offsets 的几种方式
    Kafka 在华泰证券的探索与实践
    Kafka 客户端是如何找到 leader 分区的
    关于Java中如何判断字符串是否为json格式
    关于JAVA递归遍历树级菜单结构
    关于JDK8 三种时间获取方法以及日期加减
    关于在Java里面,时间的一些业务
    关于Java的IO通信
    关于git同时提交到2个仓库gitee github
    关于JVM——工具(二)
  • 原文地址:https://www.cnblogs.com/lkwkk/p/14214241.html
Copyright © 2011-2022 走看看