• 登陆与注册-js代码


    <!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=utf-8" />
    <title>无标题文档</title>
    <script type="text/javascript">
    function check(flag){
        var name2=document.formname.name1;
        var password2=document.formname.password1;
        if(name2.value==""){
            alert("用户名不能为空");
            name2.focus();
            return false;
        }
        if(password2.value==""){
            alert("密码不能为空")
            password2.focus();
            return false;
        }
        if(flag==1){
            document.formname.action="5秒后跳转.html";
        }else if(flag==2){
        document.formname.action="123.jsp";
        }
        document.formname.submit();
    }
    </script>
    </head>
    <body>
    <form  name="formname" method="post" ">
    用户名:<input type="text" name="name1"  /><br />
    密码:<input type="password" name="password1"  /><br />
    <input type="button"  value="登陆"  onclick="check(1)"/>
    <input type="button" value="注册"  onclick="check(2)" />
    </form>
    </body>
    </html>
  • 相关阅读:
    TestNG+maven+idea 环境基本使用
    linux基本命令
    linux -查看cpu 内存 磁盘 端口 进程
    Scanner类、Random类、ArrayList 类
    (四)面向对象
    (三)数组
    (二)流程-循环
    (一)java基础_常量+变量+数据类型+运算符+方法
    SQL (二)
    SQL(一)
  • 原文地址:https://www.cnblogs.com/yunmengxiaohe/p/3864071.html
Copyright © 2020-2023  润新知