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


相关推荐

  • Windows 定时执行脚本[通俗易懂]

    Windows 定时执行脚本[通俗易懂]Windows定时执行脚本1、参考资料windows设置定时执行脚本2、解决办法由于Windows系统,无法使用Linux下强大的crontab命令,所以该定时任务也是针对Windo系统的具体操作步骤右击【我的电脑】,选择【管理】在【任务计划程序】面板中点击【创建基本任务】输入任务的【名称】和【描述】当然是希望每天自动执行防疫打卡啦~设置每天执行任务的时间,以及每隔几天执行一次该任务选择【启动程序】选择启动程序的startup.bat

    2022年7月17日
    58
  • 微软E5账号OneDrive无法扩容解决方案(亲测有效)「建议收藏」

    微软E5账号OneDrive无法扩容解决方案(亲测有效)「建议收藏」E5账号OneDrive默认存储空间为1T,可通过以下方式进行扩容12如按照以上方法扩容失败,则本篇文章可能对您有帮助,请继续阅读1.下载安装SharePointOnlineManagementShell 官方下载地址: https://www.microsoft.com/zh-CN/download/details.aspx?id=355882.在SharePointOnlineManagementShell中输入以下命令1.Conn..

    2025年10月14日
    2
  • 【转载】通过sqlserver日志恢复误删除的数据

    【转载】通过sqlserver日志恢复误删除的数据

    2021年11月21日
    51
  • Winform 界面 美化 界面库

    Winform 界面 美化 界面库官网[url=http://www.gotrance.com][/url][img=http://img.bbs.csdn.net/upload/201502/07/1423310141_531797.jpg][/img][img=http://img.bbs.csdn.net/upload/201502/07/1423310172_452400.jpg][/im

    2022年5月27日
    31
  • iPhone各机型屏幕尺寸

    iPhone各机型屏幕尺寸机型 尺寸 点(Point) pixel iPhone4/4s 3.5英寸 320×480 960×640 iPhone5/5s/SE 4.0英寸 320×568 640×1136 iPhone6/6s/7/8 4.7英寸 375×667 750×1334 iPhone6p/6sp/7p/8p 5.5英寸 414×736 1242×2208 iPhoneX/…

    2022年5月14日
    99
  • spring ajax 长轮询,Ajax轮询和长轮询

    spring ajax 长轮询,Ajax轮询和长轮询缺点:Ajax轮询需要服务器有很快的处理速度与快速响应。longpoll需要很高的并发,体现在同时容纳请求的能力。一、轮询是在浏览器客户端实现的:如果从后端获取数据成功则停止请求。$(function(){varcode,status;functiongetResult(){varparams={code:code,operate:’什么操作TODO:’,};$.ajax({typ…

    2022年10月14日
    5

发表回复

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

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