html+JavaScript登陆注册界面

html+JavaScript登陆注册界面最近刚刚学习了一些关于JavaScript的知识,便在之前学习的html前端的基础上做了一些简单的修改,本身还存在着很多的缺陷,希望大家多多指正。githu下载地址:https://github.com/pengxiang1998/login[登陆界面2在线预览]:https://pengxiang1998.github.io/login/index/denglu.html[注…

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

最近刚刚学习了一些关于JavaScript的知识,便在之前学习的html前端的基础上

做了一些简单的修改,本身还存在着很多的缺陷,希望大家多多指正。

githu下载地址:https://github.com/pengxiang1998/login

[登陆界面2在线预览]:https://pengxiang1998.github.io/login/index/denglu.html
[注册界面在线预览]:https://pengxiang1998.github.io/login/index/zhuce.html

<title>登录</title>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
    <script type="text/javascript">
        function val(){
            var name=window.document.getElementById("user").value;
            var password=window.document.getElementById("password").value;//获取值
            if (name == ""||password ==""){
                window.alert("用户名或密码不能为空!");
                return false;
            }
        
             if(name!="12345678"||password!="12345678"){//判断用户名密码登录
                window.alert("用户名或密码错误!");
                return false;
            }
            return true;
        }
    </script>
    <style type="text/css">
a{text-decoration:none}
</style>
</head>
<body >
<table border=0 ><tr><th width=2000 height=150 border=1 bgcolor='ccffff'><center><table><th><img src="images/30.jpg" width='100' height='100'></th>
<th><font size='7' color='ff7517'>图书用户管理系统</th></table></center></th><tr>
<table style="background-image:url(images/.jpg);background-size: 100%; opacity: 1; filter: alpha(opacity = 30)"><th >
<table border=0><tr><th width=1500 height=600 border=1><img src="images/4.jpg" height='400' width=400></th><th>
<form action="form.html" method="post" onsubmit="return val()" target="_blank">
<table border=0 bgcolor=F0F0F0>
<tr><th width=12 height=45></th><th colspan=3 width=82 height=45 align='left'>账户登录</th></tr>
<tr><th width=12 height=20></th><th width=20 height=20><img src="images/7.png" ></th><th width=50 height=20>
<input type="text" style="height:40px" placeholder="手机号/会员号/邮箱地址" size=40 id="user"></th><th width=12 height=20></th></tr>
<tr><th colspan=4 width=94 height=20></th></tr>
<tr><th width=12 height=20></th><th width=20 height=20><img src="images/8.png" ></th><th width=50 height=20>
<input type="password" style="height:40px" placeholder="?" id="password" size=40></th><th width=12 height=20></th></tr>
<tr><th colspan=4 width=94 height=20></th></tr>
<tr><th width=12 height=20></th>
<th colspan=2 width=70 height=20 bgcolor=FF5809><input type="submit" 
    style="background-color:FF5809;height:40px;width:140px;font-size:20px;color:white;border:none" 
    value="登录" ></th>
    <th width=12 height=20></th></tr>
    <tr><th colspan=4 width=94 height=20></th></tr>
<tr><th width=12 height=20></th><th width=70  height=20 colspan=2><img src="images/9.png" ></th><th width=12 height=20></th></form></tr>
<tr><th colspan=4 width=94 height=6></th></tr>
<tr><th width=12 height=40><th colspan=2><table width=310 border=0><tr><th  width=35 height=20 align='left'><font size=2>忘记密码</font></th>
<th  width=35 height=20 align='right'><font size=2><a href="zhuce.html" target="_blank">免费注册</a></font></th></tr></table></th><th></th></tr>
<tr><th colspan=4 width=94 height=6></th></tr>
</table>

</th><th width='700'></th></tr></table></th><tr><th bgcolor='f9fa9b' height=120><p>?联系邮箱:1234@qq.com</p><p>联系地址:</p><p>?联系电话:178****6451</p></th></table>
</body>


html+JavaScript登陆注册界面


<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312" />
<title>注册</title>
<meta http-equiv='content-type' content='text/html;charset=utf-8'/> 
        <script type='text/javascript' src='jquery-1.7.2.js'></script> 
        <script type='text/javascript'> 
        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 validate(){
            
            var password=document.getElementById("password").value;
            if (password.length<8){
                alert("密码至少为8位!");}
            var inputCode = document.getElementById("input").value.toUpperCase(); //取得输入的验证码并转化为大写         
            if(inputCode.length <= 0) { //若输入的验证码长度为0   
                alert("请输入验证码!"); //则弹出请输入验证码   
            }else if(inputCode != code ) { //若输入的验证码与产生的验证码不一致时   
                alert("验证码输入错误!@_@"); //则弹出验证码输入错误   
                createCode();//刷新验证码   
                document.getElementById("input").value = "";//清空文本框   
            }else { //输入正确时   
                alert("合格!^-^"); 
            } 
        } 
        </script> 
        <style type='text/css'> 
        #code{ 
            font-family:Arial,宋体; 
            font-style:italic; 
            color:blue;
            size:12px;            
            border:0; 
            padding:2px 3px; 
            letter-spacing:8px; 
            font-weight:bolder; 
        } 
        </style> 
</head>

<body onload='createCode()'>
<table border=0><tr><th width=200 height=30></th><th ><img src="images/3.jpg"></th></tr></table>
<table border=0><tr><th width=700 height=400></th><th>
<form >
<table border=0 height=400 >
<tr><th height=65><font  size='4'>用 户 名</th><th><input type="text" style="height:40px" placeholder="请输入用户名" size=40 name="username"></th></tr>
<tr><th height=65><font  size='4'>密    码</th><th><input type="password" style="height:40px" placeholder="密码长度为6~18字符" size=40 id="password"></th></tr>
<tr><th height=65><font  size='4'>确认密码</th><th><input type="password" style="height:40px" placeholder="请重新输入密码" size=40 id="password1"></th></tr>
<tr><th height=65><font  size='4'>联系方式</th><th><input type="text" style="height:40px" placeholder="+86" size=40 name="username"></th></tr>
<tr><div><th><font  size='4'>验 证 码</th><th>   
            <input type = "text" id = "input" style="height:40px;width:220px"/>   
            <input type="button" id="code" onclick="createCode()" style="height:40px;width:80px" title='点击更换验证码' /> 
            <!--<input type = "button"  style="height:40px"  value = "验证" onclick = "validate()"/> -->
            </th>
        </div>  </tr>
        
        <tr><th colspan=2 height=65><input type="checkbox"><font size='2' color='red' required/>我已阅读并同意相关条例</font></input></th></tr>
<tr><th colspan=2 height=65><input type='submit' style="background-color:red;height:55px;width:160px;font-size:25px;color:white;border:none" value='注册'id='l' onclick = "validate()" ></th></tr>
</table>
</form></th></tr></table>
<table><tr><th bgcolor='f9f8ed' height=200 width=2000><p>?联系邮箱:123456@qq.com</p><p>联系地址:</p><p>?联系电话:178****6451</p></th></tr></table></body>
</body>
</html>

html+JavaScript登陆注册界面

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

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

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


相关推荐

  • word打印A4纸翻页小册子设置「建议收藏」

    word打印A4纸翻页小册子设置「建议收藏」要实现的是A4纸对折成翻页的小册子在word里选页面布局设置如下:还有页脚的页数显示要改成左页的页数在左下角,右页的页数在右下角:有页码显示时双击页脚会出来页码设置,选择双面打印2。转成pdf:点打印图标,选择导出pdf…

    2022年9月6日
    4
  • python常见的5种框架

    python常见的5种框架1.scrapy框架scrapy框架是一套比较成熟的python爬虫框架,是使用python开发的快速、高层次的信息爬取框架,可以高效率地爬取web页面并提取出我们关注的结构化数据。scrapy框架的应用领域有许多,比如网络爬虫,数据挖掘、数据监测、自动化测试等。scrapy框架是一套开源的框架,…

    2022年6月6日
    1.1K
  • VLAN的作用:_vlan是什么

    VLAN的作用:_vlan是什么1.什么是VLAN:VLAN就是虚拟局域网,逻辑上将一个物理局域网划分为多个虚拟的局域。2.vlan的优点:1.将不同设备加入不同VLAN可以有效的减少广播风暴的危害。2.vlan可以将处于不同位置的物理设备逻辑的划分到同一工作组中,便于管理员管理。3.不同VLAN之间不能直接通信,隔离了流量,对用户更安全。…

    2022年8月10日
    3
  • SpringBoot实战第六章-Spring Boot核心

    SpringBoot实战第六章-Spring Boot核心

    2021年5月16日
    108
  • pycharm如何创建py文件_pycharm输入不了

    pycharm如何创建py文件_pycharm输入不了PyCharm是一款很好用的编写Python工程的IDE,用PyCharm创建一个Python文件或者向工程添加一个.py文件时,为了更好的使所编写的代码在各操作环境更好的运行,我们往往需要在.py文件中添加头文件标注相关信息。例如:打开PyCharm程序,根据菜单栏中按照如下进入设置:File->settings->Editor->FileandCodeTem…

    2022年8月26日
    5
  • 面向过程,面向对象,面向接口,面向切面的区别

    面向过程,面向对象,面向接口,面向切面的区别

    2021年7月16日
    79

发表回复

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

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