login.html

来自「shooting flash game with script」· HTML 代码 · 共 42 行

HTML
42
字号
<html>
  <head>
    <style>
      body { font-family: Verdana; font-size: 18; font-weight: bold; color: red; text-align: center; }
      input { font-family: Verdana; font-size: 16; }
    </style>
    <script>
        
        function checkInput() {
            var input_field = document.getElementById("name");
            var input = input_field.getAttribute("value");
            if (input.length == 0) {
                alert("Please enter a name!");
                return false;
            }
            var reg = new RegExp("\\W");
            if (input.match(reg)) {
                alert("Invalid user name!\nPlease don't use space and the following characters.\n\"\':;<>()[]{}!@#$%^&*-+=");
                return false;
            }
            return true;
        }
    </script>
  </head>
  <body bgcolor="#CCCCFF">
    <form method="POST" action="login.php" onsubmit="return checkInput();">
      <p>
        Please enter your user name:
        <input name="name" id="name" type="text" size="10" maxlength="10" />&nbsp;

 	 <select name="agentname">
            <option selected>Merlin</option>
            <option>Peedy</option>
            <option>Genie</option>
            <option>Robby</option>
        </select>

      </p>
      <input type="submit" value="Go!">
    </form>
  </body>
</html>

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?