Comments (15)
终于解决了 还得是这个方法....
加两个属性
type="text"
style="-webkit-text-security:disc;"
from the-front-end-knowledge-you-may-not-know.
dispaly:none;在新的版本无效,最好的方法是在第一个有效的密码框前面加上一个假的密码框,并设置宽高为0,border为none
from the-front-end-knowledge-you-may-not-know.
<input autocomplete=off>
确实不管用。
只能使用奇技淫巧了:在表单最上面新建两个用户名和密码的隐藏的 input
。
from the-front-end-knowledge-you-may-not-know.
感谢大家热情的为我提供帮助,最后通过参考这篇文章解决了我的问题:文章链接
我的代码如下:
<form action="?" method="post">
<input type="text" style="display: none;">
<input type="password" class="form-control" placeholder="" autocomplete="new-password">
<input type="submit" value="提交">
</form>
from the-front-end-knowledge-you-may-not-know.
<input autocomplete=off>
from the-front-end-knowledge-you-may-not-know.
我已经尝试了这样的写法,但是没有任何效果。
from the-front-end-knowledge-you-may-not-know.
用 <input autocomplete="new-password">
应该不会提示保存的密码了
from the-front-end-knowledge-you-may-not-know.
from the-front-end-knowledge-you-may-not-know.
我尝试了你们推荐的方法,但是还是不行。我的谷歌版本是:版本 67.0.3396.79(正式版本)
谷歌浏览器的保存密码只要点了保存之后就会有这个提示。
from the-front-end-knowledge-you-may-not-know.
使用autocomplete = 'new-password'
from the-front-end-knowledge-you-may-not-know.
你没认真看我的回复吧
from the-front-end-knowledge-you-may-not-know.
@justjavac
看了你的回复,但是隐藏表单必须是text
类型,而且还有加autocomplete = new-password
from the-front-end-knowledge-you-may-not-know.
<input type="password" [(ngModel)]="password" name="password" style="display:none">
<input nz-input type="password" autocomplete="new-password" [(ngModel)]="password" name="password" placeholder="请输入密码" id="password">
我是这样实现的
from the-front-end-knowledge-you-may-not-know.
我知道的方法是 再你实际的表单上面加俩input 然后隐藏掉
from the-front-end-knowledge-you-may-not-know.
2023年了 还有什么新办法吗
from the-front-end-knowledge-you-may-not-know.
Related Issues (20)
- Async Clipboard API:异步剪贴板 API HOT 3
- window.performance 性能对象 HOT 1
- navigator.vibrate 手机震动API
- Syntax Error of the Title HOT 1
- try-catch 退出 forEach 循环 HOT 10
- 用fetch在控制台测试接口 HOT 3
- 清空 input[type="file"] 的值 HOT 4
- pointer-events: none; 穿透当前元素,由“下面”的元素接收事件 HOT 4
- 利用 URLSearchParams 对象获取URL之中的查询字符串,即问号之后的部分 HOT 6
- 利用toString检测浏览器devTool是否为开启状态 HOT 7
- 面试题,css中哪些属性对页面repaint和reflow影响最大 HOT 4
- Array.isArray(Array.prototype) === true HOT 1
- 不打印出 console 信息出现在文件哪一行 HOT 1
- PC端 Vue-SPA项目 如何做好首屏渲染优化 HOT 3
- 获取图片原始尺寸 HOT 7
- [Docs] README 错别字 顾名思义
- 小技巧:已知年月,求该月共多少天? HOT 6
- 通过AbortController中止fetch请求后,如何判断返回的error是否属于AbortError? HOT 1
- 如何禁止 chrome 弹窗提示保存密码呢
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from the-front-end-knowledge-you-may-not-know.