You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

145 lines
4.4 KiB

<%@page import="java.sql.ResultSet"%>
<%@ page language="java" contentType="text/html; charset=UTF-8"
pageEncoding="UTF-8"%>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core"%>
<%@ page import="com.dao.infomationDao"
import="com.bean.infomationBean,java.util.*"%>
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<link rel="stylesheet" type="text/css" href="./static/css/semantic.min.css">
<link rel="stylesheet" href="./static/css/index.css">
<title>个人信息添加</title>
</head>
<script type="text/javascript">
function validate() {
var realname = document.getElementById("name");
var telephone = document.getElementById("telephone");
var email = document.getElementById("email");
// 邮箱格式正则表达式
var emailPattern = /^([a-zA-Z0-9_-])+@([a-zA-Z0-9_-])+(.[a-zA-Z0-9_-])+/;
// 手机号格式正则表达式
var phonePattern = /^1(3|4|5|6|7|8|9)\d{9}$/;
if (name.value == "") {
alert("姓名不能为空!");
name.focus();
return false;
}
if (telephone.value == "") {
alert("手机不能为空!");
telephone.focus();
return false;
} else if (!phonePattern.test(telephone.value)) {
alert("手机号格式不正确!");
telephone.focus();
return false;
}
if (email.value == "") {
alert("邮箱不能为空!");
email.focus();
return false;
} else if (!emailPattern.test(email.value)) {
alert("邮箱格式不正确!");
email.focus();
return false;
}
return true;
}
</script>
<body>
<!--导航-->
<nav class="ui inverted segment m-padded-tb-mini">
<div class="ui container">
<div class="ui inverted secondary stackable menu">
<h2 class="ui teal header item">Blog</h2>
<a href="index.jsp" class="active m-item item m-mobile-hide">首页</a>
<a href="Blog.jsp" class="m-item item m-mobile-hide">博客</a>
<a href="types.jsp" class="m-item item m-mobile-hide">分类</a>
<a href="tags.jsp" class="m-item item m-mobile-hide">标签</a>
<!-- <a href="PersonalCenter.jsp" class="m-item item m-mobile-hide">归档</a> -->
<a href="MessageBoard.jsp" class="m-item item m-mobile-hide">留言板</a>
<a href="MyCenter.jsp" class="m-item item m-mobile-hide">我的</a>
<a href="PublishArticle.jsp" class="m-item item m-mobile-hide">发表博客</a>
</div>
</div>
<a href="#" class="ui menu toggle black icon button m-right-top m-mobile-show">
<i class="sidebar icon"></i>
</a>
</nav>
<div class="left image">
<form>
<p align="center">
<img src="./static/images/logion.jpg" class="logion image"
style="width: 1000px; height: 200px;">
</p>
</form>
</div>
<p class="ui teal header" align="center">个人信息添加</p>
<form action="infomationAddServlet" method="post" onsubmit="return validate()">
<p align="center">
姓&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;名:<input
type="text" name="name" id="name">
</p>
<p align="center">
性&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;别:<input type="radio" name="sex" checked="checked" value="男">男
&nbsp;&nbsp; &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="radio" name="sex" value="女">女
</p>
<p align="center">
当前所在地:<input type="text" name="location">
</p>
<p align="center">
手&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;机:<input type="text" id="telephone" name="telephone">
</p>
<p align="center">
邮&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;箱:<input type="text" id="email" name="email">
</p>
<p align="center">
个&nbsp;人&nbsp;简&nbsp;介:<input type="text" id="introduce" name="introduce">
</p>
<p align="center">
<input type="submit" value="保存">
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
<input type="reset" value="取消">
</p>
</form>
<!--底部-->
<footer class="ui inverted vertical segment m-padded-tb-massive">
<div class="ui center aligned container">
<div class="ui inverted section divider"></div>
<p class="m-text-thin m-text-spaced m-opacity-tiny">Copyright ©
IT博客欢迎您</p>
</div>
</footer>
</body>
</html>