web(1D)

 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<%@ page language="java" contentType="text/html; charset=GBK" %>
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />

<title>logon页面</title>
</head>
<script language="javascript">

	function checkPage(){
		var top=null;
		var current=null;
		var url="<%=request.getContextPath()%>";
		if(opener!=null){
			top=opener.top;
			current=opener;
		}else{
			current=this;
			top=this.top;
		}
        if(top!=current){
            if(opener!=null){
                top.location.href=url;
                window.close();
            }else{
                top.location.href=url;
            }
		}
	}

	function checkDate(){
		var name=form1.j_username.value;
		var pass=form1.j_password.value;
		var times=form1.times.value;
		if(times.length==0){
			times=0;
		}
		if(name.length==0){
			alert("请输入帐号!");
			form1.j_username.focus();
			return false;
		}else if(pass.length==0){
			alert("请输入密码!");
			form1.j_username.focus();
			return false;
		}else{
			form1.times.value=eval(times)+1;
			form1.submit();
		}
	}
    function init(){
		cf_init();
        form1.j_username.focus();
    }
    
   

</script>
<body>
<div class="container">
  <div class="pagebody">
  <div class="form">
  <form name="form1" method="post"  action="j_security_check">
        <table cellpadding="2" cellspacing="1" border="0">
          <tbody>
            <tr>
              <td align="right" width="64">用户名:</td>
              <td><input name="j_username" id="j_username" type="text" style="width: 118px; height:15px;" /></td>
              <td rowspan="2" onClick="return checkDate();"><a href="#">
              <input type="button" value="登录"/>           
              <img src="images/btn.png" width="57" height="51"/></a></td>
              
            </tr>
            <tr>
              <td align="right">密  码:</td>
              <td> <input name="j_password" id="j_password" type="password" style="width: 118px; height:15px;" /><input type="hidden" name="times" value=0></td>
            </tr>           
          </tbody>
        </table>
        </form>      
    </div>
  </div>
</div>
</body>
</html>


你可能感兴趣的:(Web,function,XHTML,Security,Class,input)