<%@ 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">
<script src="/servlet/scripts/jquery/jquery.min.js"></script>
<title>用户登陆界面</title>
<script>
var um;pwd;
um=document.getElementById("username").value;
pwd=document.getElementById("password").value;
function myFunction(){
if(un.length<6 || un.length>16){
document.write("输入帐号长度错误");
}else if(pwd.indexOf('admin')<=0){
document.write("输入密码格式错误");
}else{
document.write("提交成功");}
}
function abc(){
if(un.readonly=true){
jq("#password").removeAttr("readonly");
jq("#username").removeAttr("readonly");
}else{
jq("#username").attr("readonly","readonly");
jq("#username").attr("readonly","readonly");
}
}
</script>
</head>
<body>
<input type="text" id="password" onchange='check()' />
<input type="text" id="username" name="username" onchange='check()' />
<button id="verification" type="button" onclick="myFunction()">登陆</button>
<button id="z" type="button" onclick="abc()">禁用/启用</button>
</body>
</html>
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">
<script src="/servlet/scripts/jquery/jquery.min.js"></script>
<title>用户登陆界面</title>
<script>
var um;pwd;
um=document.getElementById("username").value;
pwd=document.getElementById("password").value;
function myFunction(){
if(un.length<6 || un.length>16){
document.write("输入帐号长度错误");
}else if(pwd.indexOf('admin')<=0){
document.write("输入密码格式错误");
}else{
document.write("提交成功");}
}
function abc(){
if(un.readonly=true){
jq("#password").removeAttr("readonly");
jq("#username").removeAttr("readonly");
}else{
jq("#username").attr("readonly","readonly");
jq("#username").attr("readonly","readonly");
}
}
</script>
</head>
<body>
<input type="text" id="password" onchange='check()' />
<input type="text" id="username" name="username" onchange='check()' />
<button id="verification" type="button" onclick="myFunction()">登陆</button>
<button id="z" type="button" onclick="abc()">禁用/启用</button>
</body>
</html>