初音的钢琴开头的歌:为什么JAVASCRIPT代码不起作用

来源:百度文库 编辑:中科新闻网 时间:2024/04/28 12:53:51
<!--#include file="../inc/config.asp" -->
<!--#include file="../inc/inc.asp" -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>管理登陆 - <%=webname%></title>
<link href="../css/maincss.css" rel="stylesheet" type="text/css">

<script language="javascript">
<!--
function checkform(){
if (document.loginForm.username.value =="")
{
alert("请填写用户名");
document.loginForm.username.focus();
return false;
}
if (document.loginForm.password.value =="")
{
alert("请填写密码");
document.loginForm.password.focus();
return false;
}

loginForm.action="chkUser.asp"
return true;
}
-->
</script>
</head>

<body>
<form action="chkUser.asp" method="post" name="loginForm" id="loginForm" onSubmit="return checkform()">
<br>
<center>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
<table border="0" cellspacing="1" width="90%" class="allfont">
<tr>
<td>
<table width="300" border="0" cellspacing="1" cellpadding="0" align="center" bgcolor="#000000">
<tr bgcolor="#FFFFFF">
<td>
<table width="100%" border="0" cellspacing="1" cellpadding="1" class="allfont">
<tr>
<td width="33%" align="right" height="30">管理员账号:</td>
<td width="67%">
<input name="UserName" maxlength="20" class="smallInput" size="20">
</td>
</tr>
<tr>
<td width="33%" align="right" height="30">管理员密码:</td>
<td width="67%">
<input type="password" name="password" maxlength="16" class="smallInput"
size="20">
</td>
</tr>
<tr>
<td colspan="2" height="15"></td>
</tr>
</table>
</td>
</tr>
<tr align="center" bgcolor="#FFFFFF">
<td height="31">
<input type="submit" name="Submit" value="确定" class="buttonface">
 
<input type="reset" name="Submit2" value="重写" class="buttonface">
</td>
</tr>
</table>
<p align="center"> </td>
</tr>
</table>
<p> </p>
<p> </p>
<p> </p>
<p> </p>
</center>
</Form>
</body>
</html>

这段代码里,表单项在任何没有填写情况下,都会跳转到chkUser.asp,检测框不起作用,请问是怎么回事

<form action="chkUser.asp" method="post" name="loginForm" id="loginForm" onSubmit="return checkform();">
看这个了吗?没有分号啊