gpt4 book ai didi

javascript - 如何在jsp页面中禁用自动完成功能

转载 作者:行者123 更新时间:2023-12-03 12:24:10 25 4
gpt4 key购买 nike

我有jsp页面,它有用户名和密码。如果我们填写用户名和密码并单击提交按钮,则浏览器会询问记住密码,然后单击它存储用户名和密码。我不这样做想要在浏览器中存储用户名和密码。我在 jsp 中使用了 autocomplete=off

<form name="indexFrm" id="indexFrm" autocomplete="off" method="post">

<!DOCTYPE html>
<html>
<head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=windows-1252">
<meta name="GENERATOR" content="Microsoft FrontPage 4.0">
<meta name="ProgId" content="FrontPage.Editor.Document">
<title>Login</title>
<script src="http://code.jquery.com/jquery-1.11.min.js"></script>

<script type="text/javascript">




function login(btnName)
{


if(window.document.indexFrm.userIdTxt.value=="")
{
alert("Enter User Id");
window.document.indexFrm.userIdTxt.focus();
return false;
}
if(window.document.indexFrm.pwdTxt.value=="")
{
alert("Enter Password");
window.document.indexFrm.pwdTxt.focus();
return false;
}else{
window.document.indexFrm.action = "../epay/abcd.jsp";
document.indexFrm.method='post';
window.document.indexFrm.submit();
}

}



</script>

</head>

<body topmargin="0" leftmargin="0" background="../images/background.gif" onLoad = 'window.document.indexFrm.userIdTxt.focus();'>
<div id="wrapper">
<form name="indexFrm" id="indexFrm" autocomplete="off" method="post">
<table width="971" border="0" align="center" cellpadding="0" cellspacing="0">
<tr>
<td width="100%" height="15" style="padding-right:4">
<div align="right">
<table border="1" width="10%" cellspacing="0" cellpadding="0" bordercolor="#FFFFFF">
<tr>
<td width="50%" height="22" bgcolor="#3F9DE5">
<p align="center"><a href="../htmlpages/mainbottom.htm" target="" class="newrightbtn">Home</a> </td>
</tr>
</table>
</div> </td>
</tr>
<tr>
<td width="100%" height="15"></td>
</tr>
<tr>
<td width="100%">
<div align="center">
<center>
<table border="1" width="60%" bordercolor="#7CC8FA" cellspacing="0" cellpadding="0">
<tr>
<td width="100%">
<table width="100%" border="0" cellpadding="0" cellspacing="1" class="newtexts">
<tr>
<td width="100%" bgcolor="#ABDCFC" colspan="2" height="20">
<p align="center" class="newhead">LOGIN</td>
</tr>
<tr>
<td width="100%" bgcolor="#D6EEFE" colspan="2" height="21">&nbsp;</td>
</tr>
<tr>
<td width="42%" bgcolor="#D6EEFE" align="right">User
Id&nbsp; </td>
<td width="58%" bgcolor="#D6EEFE"><input type="text" name="userIdTxt" size="20" autocomplete="off"></td>
</tr>
<tr>
<td width="42%" bgcolor="#D6EEFE" align="right">Password&nbsp;
</td>
<td width="58%" bgcolor="#D6EEFE"><input type=password name="pwdTxt" id="pwdTxt" size="20" autocomplete="off"></td>
</tr>

<td width="100%" colspan="2"><input name="stdSubBtn" type="button" class="newtexts" style="font-family: MS Sans Serif; font-size: 8pt; font-weight: bold" onClick = 'login(this.name);' ></td>




</table>
<input type="hidden" name="frmName" value="indexFrm">
</form>
</div>
</body>
</html>

最佳答案

自动完成适用于 HTML5.0,我认为您正在使用下面的内容,只需将您的 doctype 标记更改为

<!DOCTYPE html>

那就试试吧。

关于javascript - 如何在jsp页面中禁用自动完成功能,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/24302207/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com