人口信息普查系统-JavaWeb-四

今天给大家分享前端人口登记页面,人口查询页面

人口登记

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
    <!DOCTYPE html>
    <html>

    <head>
        <meta charset="UTF-8">
        <title>人口登记</title>
        <style>
            .a {
                margin-top: 20px;
            }
            
            .b {
                font-size: 20px;
                width: 160px;
                color: white;
                background-color: greenyellow;
            }
        </style>
    </head>

    <body>
        <%
    Object message = request.getAttribute("message");
    if(message!=null && !"".equals(message)){

%>
            <script type="text/javascript">
                alert("<%=request.getAttribute("
                    message ")%>");
            </script>
            <%} %>
                <div align="center" id="div1">
                    <h1 style="color: rgb(165, 143, 143);">人口信息登记</h1>
                    <form action="/人口普查系统HtmlJsp/servlet?method=add" name="information" method="post" onsubmit="return check()">
                        <div class="a">
                            <label>户别:</label>
                            <input type="radio" name="hubie" value="家庭户" checked="checked" />家庭户
                            <input type="radio" name="hubie" value="集体户" />集体户
                        </div>
                        <div class="a">
                            <label>住房类型:</label>
                            <input type="radio" name="type" value="家庭住宅" checked="checked" />家庭住宅
                            <input type="radio" name="type" value="集体住所" />集体住所
                            <input type="radio" name="type" value="工作地住所" />工作地住所
                            <input type="radio" name="type" value="其他住宅" />其他住宅
                            <input type="radio" name="type" value="无住宅" />无住宅
                        </div>

                        <div class="a">
                            本户现住房面积:<input type="text" id="sqare" name="spare" runat="server" maxlength="100" size="10" onblur="if(/[^0-9]/.test(this.value)){alert('Error');}" />平方米
                        </div>

                        <div class="a">
                            本户现住房间数:<input type="text" id="jian" name="number" runat="server" maxlength="100" size="10" onblur="if(/[^0-9]/.test(this.value)){alert('Error');}" /></div>

                        <div class="a">
                            房主姓名:<input type="text" id="owname" name="name" />
                        </div>

                        <div class="a">
                            身份证号码:<input type="text" id="idcard" name="idcard" maxlength="18" onKeyUp="value=value.replace(/[\W]/g,'')" />
                        </div>

                        <div class="a">
                            <label>性别:</label>
                            <input type="radio" name="sex" value="男" checked="checked" /><input type="radio" name="sex" value="女" /></div>

                        <div class="a">
                            民族<input type="text" id="zu" name="nation" />
                        </div>

                        <div class="form-group">
                            <label for="education">受教育程度:</label>
                            <select name="education" class="form-control" id="education">
                <option value="研究生">研究生</option>
                <option value="大学本科">大学本科</option>
                <option value="大学专科">大学专科</option>
                <option value="高中">高中</option>
                <option value="初中">初中</option>
                <option value="小学">小学</option>
                <option value="未上过学">未上过学</option>
            </select>
                        </div>

                        <div class="a">
                            <button type="submit" class="b">保   存</button>
                        </div>
                        <div class="a">
                            <a href="index.jsp">返回</a>
                        </div>
                    </form>
                </div>
                <script Language="javaScript">
                    function check() {
                        if (document.information.sqare.value == "") {
                            alert("住房面积不能为空.");
                            document.information.sqare.focus();
                            return false;
                        }
                        if (document.information.jian.value == "") {
                            alert("房间数不能为空.");
                            document.information.jian.focus();
                            return false;
                        }
                        if (document.information.owname.value == "") {
                            alert("房主姓名不能为空.");
                            document.information.owname.focus();
                            return false;
                        }
                        if (document.information.idcard.value == "") {
                            alert("身份证号不能为空.");
                            document.information.idcard.focus();
                            return false;
                        }
                        if (document.information.zu.value == "") {
                            alert("民族不能为空.");
                            document.information.zu.focus();
                            return false;
                        }
                        var a = document.information.idcard.value.length;
                        if (a != 18) {
                            alert("身份证位数应为18位.");
                            document.information.idcard.focus();
                            return false;
                        }
                        var reg = /^[0-9]+.?[0-9]*$/;
                        /*for(var i=0;i<a;i++)
                        {
                            if (reg.test(document.information.idcard.value.charCodeAt(i))) {}
                            else if(document.information.idcard.value.charCodeAt(i)==X&&i==12){}
                            else if(document.information.idcard.value.charCodeAt(i)==x&&i==12){}
                            else{
                                alert("身份证输入非法字符");
                                document.information.idcard.focus();
                                return false;
                            }
                        }*/
                        return true;
                    }
                </script>
    </body>

    </html

人口信息查询

 

<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
</head>

<body>
    <form action="/人口普查系统HtmlJsp/servlet?method=show" method="POST">
        请输入户主姓名
        <input type="text" name="name"><br>
        <input type="submit" value=查询> </form>
</body>

</html>

 

<%@ page language="java" contentType="text/html; charset=UTF-8"
         pageEncoding="UTF-8"%>
<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <title>Insert title here</title>
    <style>
        .a{
            margin-top: 20px;
        }
        .b{
            font-size: 20px;
            width: 160px;
            color: white;
            background-color: greenyellow;
        }
    </style>
</head>
<body>
<div align="center">
    <h1 style="color: cyan;">信息查询</h1>
    <form action="/人口普查系统HtmlJsp/servlet?method=Serach" method="post" onsubmit="return check()">
        <div class="a">
            房主姓名:<input type="text"  name="name"/>
        </div>

        <div class="a">
            <label>性别:</label>
            <input type="radio" name="sex" value="男"/><input type="radio" name="sex" value="女"/></div>

        <div class="a">
            民族<input type="text"  name="nation"/>
        </div>

        <div class="form-group">
            <label for="address">受教育程度:</label>
            <select name="education" class="form-control" id="address">
            <option value=" "></option>
                <option value="研究生">研究生</option>
                <option value="大学本科">大学本科</option>
                <option value="大学专科">大学专科</option>
                <option value="高中">高中</option>
                <option value="初中">初中</option>
                <option value="小学">小学</option>
                <option value="未上过学">未上过学</option>
            </select>
        </div>

        <div class="a">
            <button type="submit" class="b">&nbsp;&nbsp;&nbsp;&nbsp;</button>
        </div>
        <div class="a">
            <a href="index.jsp" >返回</a>
        </div>
    </form>
</div>
</body>
</html>

 

posted @ 2021-10-30 21:08  山海自有归期  阅读(163)  评论(0编辑  收藏  举报