为什么不提示用户名为空呢?

来源:百度知道 编辑:UC知道 时间:2024/05/24 14:17:52
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>无标题文档</title>
<script language=JavaScript>
function check()
{
if(document.forml.yfm.value=="")
{
alert("用户名不能为空");
return false;
}
if(document.forml.mm.value=="")
{
alert("密码不能为空");
return false;
}
}
</script>
</head>

<body><form name="form1" method="post" action=""onsubmit="javascript:return check();">
<div align="center">
<table width="283" border="0" cellpadding="0" cellspacing="0">
<!--DWLayoutTable-->
<tr>
<td height="25" colspan="3" valign="top"><input type="text&

<form name="form1" method="post" action=""onsubmit="javascript:return check();">
不该省的空格不能省,:<form name="form1" method="post" action="" onsubmit="return check()">
不该多的不要多(onsubmit="return check()")
最后,也是最关键的:
把document.forml里面的l(L)换成1呀!