此题考察的对JDBC连接数据库以及IO读写操作的熟练程度
代码如下:
<!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">
<!-- 第二阶段测试 24题 -->
<title>登录页面</title>
</head>
<body>
<!-- 登录框架 宽:400px 高:600px-->
<div style="width: 400px; height: 600px; margin: 0 0 0 40%;">
<!-- 登录选项以table形式存放 -->
<table>
<tbody>
<tr>
<td>用户名:</td>
<td><input type="text" id="user" onblur="checkInfo(1)"><span id="userCheck"></span></td>
</tr>
<tr>
<td>密码:</td>
<td><input type="password" id="pwd" onblur="checkInfo(1)"><span id="pwdCheck"></span></td>
</tr>
</tbody>
</table>
<!-- 登录按钮 -->
<div style="margin-left: 20%;">
<button id="login_btn" type="submit" onclick="checkInfo(2)">登录</button>
</div>
</div>
<!-- 验证功能:1.信息是否为空 2.密码长度是否大于8给出相应提示-->
<script type="text/javascript">
function checkInfo(t){
var user = document.getElementById("user");
var pwd = document.getElementById("pwd");
if(user.value == '' || user.value == null && t==1){
document.getElementById("userCheck").innerText = "请输入用户名";
}
if(pwd.value == '' || pwd.value == null && t==1){
document.getElementById("pwdCheck").innerText = "请输入密码";
}
if(t==2){
if(user.value==''|| pwd.value ==null || pwd.value.length<8){
alert("输入信息有误,请检查");
}else{
alert("登录成功");
}
}
}
</script>
</body>
</html>
标签:文件,File,getElementById,value,pwd,user,filecontent,document
From: https://www.cnblogs.com/GeniusWang/p/16916820.html