倒,楼主似乎走错地方了function checkValues()
{
var AccountID;
var AccountIDLength;
var Passw;
var PassLength;
var txtAccountID;

AccountID=document.form3.txtAccountID.value;
AccountIDLength=AccountID.lentgh;
Passw=document.form3.txtPass.value;
PassLength=passw.length;
if(AccountIDLength==0)
{
alert("You cannot login if you do not enter your login");
document.form3.txtAccountID.focus();
}
if(PassLength==0)
{
alert("You cannot login if you do not enter your password")
document.form3.txtPass.focus();
}
}

解决方案 »

  1.   

    哦,还是不对,你的html设计的都有问题
      

  2.   

    问个问题javascrpt也是用function的吗?感觉VBSCRIPT才用这个的
      

  3.   

    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
    <html>
    <head>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <title>Earnest Bank</title>
    <style type="text/css">
    <!--
    .style1 {font-size: x-large}
    -->
    </style>
    <link href="CSS/Level2_Times_Forms.css" rel="stylesheet" type="text/css">
    <script language="javascript">
    function checkValues()
    {
    if(document.form3.txtAccountID.value.length==0)
    {
    alert("You cannot login if you do not enter your login");
    document.form3.texAccountID.focus();
    }
    if(document.form2.txtpass.value.length==0)
    {
    alert("You cannot login if you do not enter your password")
    document.form2.txtpass.focus();
    }
    }
    </script></head><body>
    <div align="center" class="style1">
      <p>Earnest Bank </p>
      <p>Banking Online</p>
      <div align="left">  
        <table width="600" border="1">
          <tr>
            <td width="120">&nbsp;</td>
            <td width="250">Login information </td>
            <td width="71">&nbsp;</td>
          </tr>
          <tr>
            <td>AccountID </td>
            <td><form name="form3" method="post" action="">
                <input type="text" name="txtAccountID" value="">
            </form></td>
            <td>&nbsp;</td>
          </tr>
          <tr>
            <td>Password</td>
            <td><form name="form2" method="post" action="">
                <input name="txtpass" type="password" value="">
            </form></td>
            <td><form name="form1" method="post" action="">
                <input type="submit" name="Submit" onClick="checkValues()" value="Submit">
            </form></td>
          </tr>
        </table>
      </div>
      <p align="left">&nbsp;</p>
      <p align="left">&nbsp;  </p>
    </div>
    </body>
    </html>
      

  4.   

    觉得你写的这个html实在是有问题,不过也只好这么将就改改了,现在应该是能用了
      

  5.   

    alert("You cannot login if you do not enter your password")
    这个要加分号 ;