可能是在HTML里没有加上以下内容:
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">

解决方案 »

  1.   

    ff.username.value 这儿出错了吧
      

  2.   

    function CheckLogin()  
    {
    var username = document.getElementById("username");
    if (username.value=="") 
    {
      alert("用户名称不能为空!");
      username.focus();
      return false;
    }
    }
      

  3.   

    在IE6.0就不会出错,而在IE5.0就会出现无效字符。在你的js文件里有全角空格,请检查一下
    ie6会忽略语句前的全角空格,而ie5只忽略语句前的半角空格
      

  4.   

    JK的必须输入验证通用函数:
    说明:
    1.用法:在必须输入的input\select里加入alt="输入内容";在form提交前判断checkNecessaryInput(theFormObj)的真假即可
    2.不足:使用了遍历,请反对遍历的朋友包涵
    http://jkisjk.vip.sina.com/code/html/checkNecessaryInput.htm