我设了但还是不管用 我的源代码 <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"> <html> <head> <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript"> function login() { if (template.logName.value.length==0) { alert("用户代码不能为空,请您重新输入!"); template.logName.focus(); return false; } if (template.password.value.length==0) { alert("用户密码不能为空,请您重新输入!"); template.password.focus(); return false; } template.submit();
jsp在tomcat下,form 已经加入了 autocomplete="on" 但仍然无效,哪位知道是怎么回事
<input type="text" name="loginName" size=20 autocomplete="on">
就应该可以了你的问题,我觉得会不会是这个input元素没有包含在<form></form>内
好象也就这一种可能了
以前是能用的,但现在要求添加下拉提示,却怎么做都不管用,下拉不出来
我的源代码
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<script language="javascript">
function login() {
if (template.logName.value.length==0) {
alert("用户代码不能为空,请您重新输入!");
template.logName.focus();
return false;
}
if (template.password.value.length==0) {
alert("用户密码不能为空,请您重新输入!");
template.password.focus();
return false;
}
template.submit();
return true;
}
</script>
</head><BODY bgColor="#99cdff" leftMargin="0" rightMargin="0" scroll="no" topMargin="1"><form name="template" method="post" action="mainservlet/login?ActionType=login"><TABLE cellPadding=0 cellSpacing=0 height="100%" width="100%"><BR>
<TBODY>
<TR bgColor=#99ccff>
<TD align=middle height=295 width=245>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="80%">
<TBODY>
<TR align=middle vAlign=center>
<TD height=100>
<TABLE border=0 cellPadding=0 cellSpacing=0 width="100%">
<TBODY>
<TR>
<TD align=right height=22 noWrap width=80><FONT class=t10
color=#042a64>用户名:</FONT></TD>
<TD width=80></TD>
<TD align=left height=22><input name="logName" type="text" size="15" >
</TD>
</TR>
<TR>
<TD align=right height=22 noWrap width=80><FONT class=t10
color=#042a64>密 码:</FONT></TD>
<TD width=80></TD>
<TD align=left height=22><input name="password" type="password" size="15" >
</TD>
</TR>
</TBODY>
</TABLE></TD></TR>
<TR align=middle vAlign=center>
<TD height=30><input type="button" name="Button" value="提交" onclick='return login();'>
<input type="reset" name="Submit2" value="重设"> </TD>
</TR>
</TABLE></TD>
</TBODY></TABLE></FORM></BODY></HTML>
<form name="template" method="post" action="mainservlet/login?ActionType=login">
移到table元素里面就可以了
<form name="template" method="post" action="mainservlet/login?ActionType=login">象这样