<HTML>简单登录页面代码

<HTML>简单登录页面代码简单登录HTML

大家好,又见面了,我是你们的朋友全栈君。

这是一个简单的静态的html页面登录图片,之前写的,验证码方面没有搞懂,这里我重新参考了这里,但是部分功能还没有完善。仅供参考

 

<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <title>静态页面登录测试</title> 
 
 <script language="javascript">
 window.onload = function() {
  createCode()
 }
 var code; //在全局定义验证码 
 function createCode() {
  code = "";
  var codeLength = 4; //验证码的长度 
  var checkCode = document.getElementById("code");
  var random = new Array(0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J', 'K', 'L', 'M', 'N', 'O', 'P', 'Q', 'R',
   'S', 'T', 'U', 'V', 'W', 'X', 'Y', 'Z'); //随机数 
  for(var i = 0; i < codeLength; i++) { //循环操作 
  var index = Math.floor(Math.random() * 36); //取得随机数的索引(0~35) 
   code += random[index]; //根据索引取得随机数加到code上 
  }
  checkCode.value = code; //把code值赋给验证码 
 }
 //校验验证码 
function validateLogin(){
    var sUserName = document.frmLogin.username.value ;
    var sPassword = document.frmLogin.password.value ;
    var inputCode = document.frmLogin.text_code.value;
    /*var sinputCode =document.frmLogin.inputcode.value ;  */
    if ((sUserName.length <= 0) || (sUserName=="")){
     alert("请输入用户名!");
     return false ;
    }
     
    if ((sPassword.length <= 0) || (sPassword=="")){
     alert("请输入密码!");
     return false ;
    }
    if ((inputCode.length<= 0) || (inputCode==NULL)){
        alert("请输入验证码!");
        return false ;
       }
   } 
  </script>
</head>
<body >
<fieldset>
<table background="images\e.jpg " width="933" height="412">
 <tr height="170">
 <td width="570px"> </td>
 <td> </td>
 </tr> 
 <tr>
<td> </td>        
<td><table>
<form method ="POST" action="http://localhost:8080/test/hello.html?login=%B5%C7%C2%BC" name="frmLogin"  >
 <tr>
 <td><label for="username">用户名:</label></td>
 <td><input type="text" name="username"  id="username" placeholder="input your name" size="20" maxlength="20" /></td>
 <td > </td>
 <td> </td>
 </tr>
 <tr>
 <td><label for="password">密  码:</label></td>
 <td><input type="password" name="password" id="password" placeholder="input your password" size="20" maxlength="20" )  this.value='';" /></td>
 <td> </td>
 <td> </td>
 </tr>
 <tr>
 <td><label for="text_code">验证码:</label></td>
 <td><input type="text" size="" name="text_code" id="text_code" /></td>
 <td><input type="button" id="code" onclick="createCode()" name=""></td>
 </tr>
 <tr>
 <td><input type="checkbox" name="zlogin" value="1">自动登录</td>
 </tr>
 </table>
 </td>
  <tr>
  <td> </td>   
  <td><table>
   <tr>
  <td><input type="submit" name="login" value="登录" onClick="return validateLogin()"/></td>
  <td><input type="reset" name="rs" value="重置"></td>
  <td><input type="button" name="button" value="注册" onclick="window.location.href='https://www.w3school.com.cn/jsref/event_onfocus.asp'"></td>
  </tr>
 </tr>
 </table>
 </td>
 </table>
</fieldset>
</form>
 
</body>
</html>

执行后如图

<HTML>简单登录页面代码

 

 

 

版权声明:本文内容由互联网用户自发贡献,该文观点仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请联系我们举报,一经查实,本站将立刻删除。

发布者:全栈程序员-站长,转载请注明出处:https://javaforall.net/130669.html原文链接:https://javaforall.net

(0)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • linux系统线程通信的几种方式,Linux的进程/线程通信方式总结

    linux系统线程通信的几种方式,Linux的进程/线程通信方式总结Linux系统中的进程通信方式主要以下几种:同一主机上的进程通信方式*UNIX进程间通信方式:包括管道(PIPE),有名管道(FIFO),和信号(Signal)*SystemV进程通信方式:包括信号量(Semaphore),消息队列(MessageQueue),和共享内存(SharedMemory)网络主机间的进程通信方式*RPC:RemoteProcedureCall…

    2022年6月20日
    47
  • 利用git上传本地文件、文件夹到Github

    利用git上传本地文件、文件夹到Github利用git上传文件至github是特别常用的,总结以下内容供参考使用。第一步:下载git工具,[这里是链接](https://git-scm.com/downloads),选择适合自己的版本进行安装。第二步:安装完成后,找到Gitbash,双击打开。第三步:输入自己的用户名和邮箱(为注册GITHUB账号时的用户名和邮箱)$gitconfig–globaluser.name”co

    2022年5月13日
    40
  • mqttnet 详解_vs2017通过mqttnet创建mqtt服务端 客户端

    mqttnet 详解_vs2017通过mqttnet创建mqtt服务端 客户端服务端:usingMQTTnet;usingMQTTnet.Server;usingSystem;usingSystem.Collections.Generic;usingSystem.ComponentModel;usingSystem.Data;usingSystem.Diagnostics;usingSystem.IO;usingSystem.Linq;usingSyst…

    2022年6月25日
    41
  • pandas中使用fillna函数填充NaN值「建议收藏」

    pandas中使用fillna函数填充NaN值「建议收藏」1.参数解析1.1inplace参数取值:True、FalseTrue:直接修改原对象False:创建一个副本,修改副本,原对象不变(缺省默认)1.2method参数取值:{‘pad’,‘ffill’,‘backfill’,‘bfill’,None},defaultNonepad/ffill:用前一个非缺失值去填充该缺失值backfill/bfill:用下一个非缺失值填充该缺失值None:指定一个值去替换缺失值(缺省默认这种方式)1.3limit参数:限制

    2022年8月12日
    9
  • java.lang.abstractMethodError的错误解决「建议收藏」

    java.lang.abstractMethodError的错误解决「建议收藏」日常开发中,如果在打包后遇到过java.lang.abstractMethodError的问题,其中一部分,可能是混淆引起的。解决方法就是把提示报错的地方,通过-keep的方式过滤掉,不让那些代码进行混淆。本人遇到的是一个RecyclerView使用时adapter中的getItemCount方法报错。原因是Adapter是内部类,而getItemCount是公共方法。getItemCo…

    2022年5月5日
    684
  • mysql查询语句执行过程及运行原理命令_MySQL常用命令

    mysql查询语句执行过程及运行原理命令_MySQL常用命令Mysql查询语句执行原理数据库查询语句如何执行?DML语句首先进行语法分析,对使用sql表示的查询进行语法分析,生成查询语法分析树。 语义检查:检查sql中所涉及的对象以及是否在数据库中存在,用户是否具有操作权限等 视图转换:将语法分析树转换成关系代数表达式,称为逻辑查询计划; 查询优化:在选择逻辑查询计划时,会有多个不同的表达式,选择最佳的逻辑查询计划; 代码生成:必须将逻辑查…

    2025年6月9日
    3

发表回复

您的邮箱地址不会被公开。 必填项已用 * 标注

关注全栈程序员社区公众号