登录页面设计

<html xmlns="http://www.w3.org/1999/xhtml">
<head>
  <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
  <title>无标题文档</title>
  <script language="javascript">
    function check(){
      var name = form1.user.value;
      var pwd = form1.pwd.value;
      var sf = form1.Type.value;
      if(sf == ""){
        alert("请选择身份!");
        form1.Type.focus();
        return;
      }else if((name=="") || (name == null)){
        alert("请输入用户名");
        form1.user.focus();
        return;
      }else if((pwd == "") || (pwd == null)){
        alert("请输入密码");
        form1.pwd.focus();
        return;
      }else{
        form1.submit();
      }
    }
  </script>
</head>

<body>
  <form name="form1" method="post" action="GoLogin.action">
    <table width="300" border="1" bordercolor="#FFFFFF" cellspacing="0" cellpadding="0"  bordercolordark="#cccccc" bordercolorlight="#FFFFF">
      <tr>
        <td height="30" colspan="2" bgcolor="#eeeeee">用户登录</td>
      </tr>
      <tr>
        <td width="70" height="30">身份:</td>
        <td>
          <select name="Type">
            <option value="">请选择</option>
            <option value="系统管理员">系统管理员</option>
            <option value="楼宇管理员">楼宇管理员</option>
            <option value="学生">学生</option>
          </select>
        </td>
      </tr>

      <tr>
        <td width="70" height="30">用户名:</td>
        <td width="162"><input name="user" type="text" id="user"/></td>
      </tr>
      <tr>
        <td height="30">密&nbsp;;&nbsp;码:</td>
        <td><input name="pwd" type="text" id="pwd" /></td>
      </tr>
      <tr>
        <td height="30" colspan="2" align="center">
          <input type="button" value="登录" onclick="return check()" />
          <input type="reset" value="重置" />
        </td>
      </tr>
    </table>
  </form>
</body>
</html>

posted @ 2017-07-08 18:34  XuGuobao  阅读(282)  评论(0编辑  收藏  举报