<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)
全栈程序员-站长的头像全栈程序员-站长


相关推荐

  • matlabfor循环变量_matlab定义自变量区间

    matlabfor循环变量_matlab定义自变量区间Matlab的循环与C/C++等普通计算机语言的循环还是有很大的区别的。看下面Matlab代码:a=[123456];fori=1:6ifi==3,i=i-1;enddisp(a(i));end结果为:123456将上述Matlab转换成C++代码:#includeusingnamespacestd;intmain(){inta[6]={1,2,3,4,5,6};for(i…

    2022年10月6日
    2
  • 手把手教你完成图像分类实战——基于卷积神经网络的图像识别

    手把手教你完成图像分类实战——基于卷积神经网络的图像识别在很多的项目中,都会用到图像识别技术。我在智能电子秤的项目中,就使用了简单的图像识别算法来完成对果蔬的分类(三分类)。图像识别中,最常用的框架就是TensorFlow,我们今天就使用这个框架,手把手教学完成图像识别分类。完成一个图像识别模块主要包括四步:采集数据集搭建合适的模型调参、训练并测试完成接口到项目中关于环境的配置我在此处不多赘余描述,可以自行百度搜索,进行环境配置:python3.6+tensorflow+opencv。关于编译器,我在此处推荐spyder。使用起来非常方便,非常

    2022年6月12日
    60
  • 30、转载樱花飘落代码,无需添加图片,个人觉得很漂亮,收藏一下![通俗易懂]

    30、转载樱花飘落代码,无需添加图片,个人觉得很漂亮,收藏一下![通俗易懂]<!DOCTYPEHTMLPUBLIC”-//W3C//DTDHTML4.0Transitional//EN”><HTML><HEAD><TITLE>NewDocument</TITLE><METANAME=”Generator”CONTENT=”EditPlus”><MET…

    2022年7月19日
    17
  • kubernetes杂谈(一)清除状态为Evicted的pod

    kubernetes杂谈(一)清除状态为Evicted的pod一现象引入使用’kubectlgetpods–all-namespaces’,发现很多’pod的状态为evicted’原因eviction,即’驱赶的意思’,意思是当节点出现异常时,kubernetes将有’相应的机制驱赶’该节点上的Pod,多见于资源不足时导致的驱赶。注意:即使集群’状态恢复’,eviction状态的pod会’在系统中存在’,需要’手动删除’–>只是影响美观解决方案排查’资源和异常原因’,防止新的驱赶产生–&g..

    2022年5月16日
    39
  • CompoundButton

    CompoundButtonCompoundButton具有两种状态的按钮,选中和未选中。当按钮被按下或点击时,状态会自动改变。这是一个抽象类,目前有的子类有复选框,单选按钮,开关,切换按钮。 复选框 复选框是一种特定类型的双状态按钮,可以选中或取消选中。 单选按钮 单选按钮是两个状态的按钮,可以选中也可以取消选中。 转变 Switch是一个双态切换开关小部件,可以在两个选项之间进行选择。 …

    2022年5月2日
    54
  • js 洗牌算法_数据库洗牌算法

    js 洗牌算法_数据库洗牌算法概念洗牌算法即是把一组数组里的元素随机组合生成一个新数组。实现constshuffle=([…arr])=>{letm=arr.length;while(m){consti=Math.floor(Math.random()*m–);[arr[m],arr[i]]=[arr[i],arr[m]];}returnarr;};//测试consttes

    2022年9月21日
    2

发表回复

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

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