标题:找错误,无法提示信息
取消只看楼主
韩学敏
Rank: 2
等 级:论坛游民
帖 子:52
专家分:26
注 册:2012-11-3
结帖率:82.35%
 问题点数:0 回复次数:0 
找错误,无法提示信息
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.
<html>
 <head>
  <title> test </title>
  <meta name="Generator" content="EditPlus">
  <meta name="Author" content="">
  <meta name="Keywords" content="">
  <meta name="Description" content="">
  <style>
   
  </style>
  <script type="text/javascript">
    function check()
    {
        var user=form1.user.value;
        var pwd=form1.pwd.value;
        if((user=="")||(user=null))
        {
            alert("请输入用户名");
            form1.user.focus();
            return;
        }
        else if((pwd="")||(pwd=null))
        {
            alert("请输入密码");
            form1.pwd.focus();
            return;
        }
        else
            form1.submit();
    }
  </script>
 </head>

 <body style="overflow:auto;">
 <form id="form1" name="form1" >
    <table>
        <tr>
            <td colspan="2" align="center">用户登录</td>
        </tr>
        <tr>
            <td>用户名:</td>
            <td><input id="user" name="user"></td>
        </tr>
        <tr>
            <td>密码:</td>
            <td><input id="pwd" name="pwd" type="password"></td>
        </tr>
        <tr>
            <td colspan="2" align="center">
                <input type="button" value="登录" onclick="check()">
                <input type="reset" value="重置">
            </td>
        </tr>
    </table>
 </body>
</html>


为什么我只输入用户名,并输入密码,不会提示我呢??
搜索更多相关主题的帖子: javascript function 提示信息 content PUBLIC 
2013-11-04 08:22



参与讨论请移步原网站贴子:https://bbs.bccn.net/thread-423006-1-1.html




关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.035654 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved