为什么有个label呀?
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<HEAD>
<TITLE> New Document </TITLE>
</HEAD>
<script language="JavaScript">
function checkform()
{
if (form1.username.value=="" || form1.username.value.length < 2) {
alert("用户名长度不能小于2,请重新输入!");
form1.username.focus();
return false;
}
}
</script>
<BODY>
<form name="form1" method="post" action="UserProc.asp" onsubmit="return checkform();">
<input name="username" >
<input type="submit" name="Submit" value="提交">
</form>
</BODY>
</HTML>
[此贴子已经被作者于2006-3-27 21:32:56编辑过]