javascript与asp写混掉了呀<%
function hit(tform)
{var pin=""
if studentuser="" then
document.all.studentname.focus()
pin<>""
document.all.studentname.focus()
alert("错误:请输入用户名")
end if
if studentuser.length>10  then
document.all.studentname.focus()
pin<>""
alert("错误:输入的用户名过长")
end if
if studentnumber="" then
document.all.studentname.focus()
pin<>""
alert("错误:请输入密码")
end if
if studentnumber.length>12 then
document.all.studentname.focus()
pin<>""
alert("错误:输入的密码过长")
end if
if pin<>"" then      //这是vbs
response.write error
response.end
end if
}
%>重写吧

解决方案 »

  1.   

    这里是ASP.NET版,不是ASP版你把客户端编码跟服务器端编码弄糊涂了,先去找本书研究一本基本的东西吧
      

  2.   

    看到你写的我发昏呀,全是vbs,上面却说是js
      

  3.   

    应该不加<script language="JavaScript">就行了
      

  4.   

    主要是你的脚本里面有问题。
    语法的问题:
    if studentnumber="" then
    document.all.studentname.focus()
    pin<>""
    alert("错误:请输入密码")
    end if你有一个“)”用的是汉字的!
      

  5.   

    试试:
    function hit()
    {var pin=""
    if (document.all("studentname").value="") 
    {
    document.all("studentname").focus();
    //pin<>""
    document.all("studentname").focus();
    alert('aaaaaaa');
    alert('错误:请输入用户名')
    }if (document.all("studentname").value.length>10) 
    {
    document.all("studentname").focus();
    //pin<>""
    alert('错误:输入的用户名过长');
    }if (document.all("studentnumber").value="" )
    {
    document.all("studentname").focus();
    //pin<>"";
    alert('错误:请输入密码');
    }if (document.all("studentnumber").value.length>12 )
    {
    document.all("studentname").focus();
    //pin<>"";
    alert('错误:输入的密码过长');
    }//if (pin<>"" )
    //{
    //response.write error;
    //response.end;
    //}
    }
    </script>
    其余的部分我注释了,你自己改改,逻辑上我没有研究含意。