• 第四周jsp作业


    <%--
      Created by IntelliJ IDEA.
      User: Dell
      Date: 2021/3/27
      Time: 19:51
      To change this template use File | Settings | File Templates.
    --%>
    <%@ page contentType="text/html;charset=UTF-8" language="java" %>
    <!DOCTYPE html>
    <html lang="en">
    <head>
        <meta charset="UTF-8">
        <title>Title</title>
        <style>
            div {
                 160px;
                height: 36px;
                background-color: #f40;
                line-height: 36px;
                text-align: center;
                color: #fff;
                font-size: 16px;
                margin: 30px auto;
                cursor: pointer;
                -webkit-user-select: none; /*禁止用户选中文字*/
            }
        </style>
    </head>
    <body>
     
    <form action="/dl_war_exploded/ss" method="post">
        <table>
            <tr>
                <td>用户名:</td>
                <td><input type="text" name="username" class="username"> </td>
            </tr>
            <tr>
                <td>密  码:</td>
                <td><input type="password" name="password" class="password"> </td>
            </tr>
     
                <td>验证码:</td>
                <td><input type="text" name="yzm" id="inyzm"></td>
            </tr>
            <tr>
                <td></td>
                <td><div id="code_box">Af3D</div></td>
            </tr>
            <tr>
                <td></td>
                <td colspan="2"><input type="submit" value="登录" onclick="yzyzm()"> </td>
            </tr>
        </table>
    </form>
    <!--<div id="code_box">Af3D</div>-->
     
    <script>
        var result;
        var code_box = document.getElementById("code_box");
     
        function refreshCode() {
     
           
            var code = '0123456789qwertyuiopasdfghjklzxcvbnmQWERTYUIOPASDFGHJKLZXCVBNM',
                char = '',
                result = '';
     
            for (var i = 0; i < 4; i++) {
     
               
                var code_index = Math.round(Math.random()*61);
               
                var char = code[code_index];
               
                if (result.toUpperCase().indexOf(char.toUpperCase()) > -1)
                   
                {
                    i --;
             
                    continue;
                }
                result += char;
            }
            code_box.innerHTML = result;
        }
        //点击事件
        code_box.onclick = refreshCode;
     
        function yzyzm() {
            var inyzm = document.getElementById("inyzm").value;
            if(inyzm!==result.toLowerCase()){
                alert("验证码输入错误");
            }
        }
    </script>
     
     
    </body>
    </html>
  • 相关阅读:
    Git ignore file for Xcode projects
    How can I create a zip archive of a whole directory via terminal without hidden files?
    What is a bare git repository?
    How to tell if UIViewController's view is visible
    Adding A Shadow To UIView
    Properties
    iOS中nil,Nil,NULL之间的区别
    FMDB的简单使用
    iOS 加载图片选择imageNamed 方法还是 imageWithContentsOfFile?
    对retain 和 assign的理解
  • 原文地址:https://www.cnblogs.com/z118127/p/14590334.html
Copyright © 2020-2023  润新知