登录首页 弹框提示 写了没出效果,请问怎么改,谢谢
要提示用户名或密码不能为空,请问要怎么改我这写了但没出效果
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<HTML>
<form action=".jsp" method="post"onsubmit="return checkform()"name="form1">
<HEAD>
<TITLE>无标题页</TITLE>
<META http-equiv=Content-Type content="text/html; charset=gbk">
<LINK
href="images/public.css" type=text/css rel=stylesheet>
<LINK
href="images/login.css" type=text/css rel=stylesheet>
<STYLE type=text/css>
</STYLE>
<script language="javascript">
function checkform()
{
if(form11.username.value==""){
alert("用户名不能为空。");
form1.username.focus();
return false;
}
if(form1.username.value.length<1‖form1.username.value.length>20){
alert("用户名超出了范围(1~20).");
form1.username.focus();
return false;
}
if(form1.password.value==""){
alertt("密码不能为空。");
form1.password.focus();
return false;
}
if(form1.password.value.length<1‖form1.password.value.length>20){
alert("密码超出了范围(1~20).");
form1.password.focus();
return false;
}
}
</script>
<META content="MSHTML 6.00.2900.5848" name=GENERATOR>
</HEAD>
<BODY>
<DIV id=div1>
<TABLE id=login height="100%" cellSpacing=0 cellPadding=0 width=800
align=center>
<TBODY>
<TR id=main>
<TD>
<TABLE height="100%" cellSpacing=0 cellPadding=0 width="100%">
<TBODY>
<TR>
<TD colSpan=4> </TD>
</TR>
<TR height=30>
<TD width=380> </TD>
<TD> </TD>
<TD> </TD>
<TD> </TD>
</TR>
<TR height=40>
<TD rowSpan=4> </TD>
<TD>用户名:</TD>
<TD>
<INPUT class=textbox id=username name=username>
</TD>
<TD width=120> </TD>
</TR>
<TR height=40>
<TD>密 码:</TD>
<TD>
<INPUT class=textbox id=password type=password
name=password>
</TD>
<TD width=120> </TD>
</TR>
<TR height=40>
<TD><br></TD>
<TD vAlign=center colSpan=2><br></TD>
</TR>
<TR height=40>
<TD></TD>
<TD align=right>
<INPUT id=btnLogin type=submit value=" 登 录 " name=btnLogin onclick="javascript:return(checkform());">
</TD>
<TD width=120> </TD>
</TR>
<TR height=110>
<TD colSpan=4> </TD>
</TR>
</TBODY>
</TABLE>
</TD>
</TR>
<TR id=root height=104>
<TD> </TD>
</TR>
</TBODY>
</TABLE>
</DIV>
<DIV id=div2 style="DISPLAY: none"></DIV>
</CONTENTTEMPLATE>
</form>
</BODY>
</HTML>