主题:脚本错误```实在是没办法了`求救```
<html>
<head>
<title>javaSCRIPT操作</title>
<script language="JavaScript">
function checkValues()
{
var name;
var namelength;
var pass;
var passlength;
name=trim(txtname.value);
namelength=name.length;
pass=trim(txtpass.value);
passlength=pass.length;
if(namelength == 0)
{
alert("You cannot login!");
txtname.focus();
}
if(passlength == 0)
{
alert("you cannot login!password error!");
txtpass.focus();
}
</script>
</head>
<body bgcolor="#FF00FF">
<form >
用户名:<input name="txtname" type="text"><br><br>
密 码:
<input name="txtpass" type="password"><br>
<input type="button" name="subbutton" value="Submit" onClick="checkValues()" >
</form>
</body>
</html>
这段代码麻烦哪位大哥修改下````并解释下错在哪里了啊``郁闷```
<head>
<title>javaSCRIPT操作</title>
<script language="JavaScript">
function checkValues()
{
var name;
var namelength;
var pass;
var passlength;
name=trim(txtname.value);
namelength=name.length;
pass=trim(txtpass.value);
passlength=pass.length;
if(namelength == 0)
{
alert("You cannot login!");
txtname.focus();
}
if(passlength == 0)
{
alert("you cannot login!password error!");
txtpass.focus();
}
</script>
</head>
<body bgcolor="#FF00FF">
<form >
用户名:<input name="txtname" type="text"><br><br>
密 码:
<input name="txtpass" type="password"><br>
<input type="button" name="subbutton" value="Submit" onClick="checkValues()" >
</form>
</body>
</html>
这段代码麻烦哪位大哥修改下````并解释下错在哪里了啊``郁闷```