阻止浏览器用详细信息填充文本框 [英] Stop browser from filling textboxes with details

查看:26
本文介绍了阻止浏览器用详细信息填充文本框的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遇到了一个非常烦人的问题,我希望这只是我错过的一个设置.我有一个 ASP.NET 应用程序,它允许用户在不同的地方输入他们的用户名/密码(例如登录、更改密码、更改用户名等).当我登录时,浏览器询问我是否要存储用户详细信息.通常,我单击否",但这次我决定单击是".现在,我的表单中的某些文本框预先填充了用户名或密码.是否可以删除这些,因为它们有时会出现在不应预填充的文本框中.我尝试设置 AutoCompleteType=noneText='' 但它仍然被预填充.除了相同的 CssClass 和密码框的 TextMode=password 之外,文本框没有太多共同点.名称是不同的,尽管有时它们包含单词 name(例如 fullName、userName).有没有办法阻止浏览器填充某些文本框?

I've run into a really annoying problem, and I'm hoping it's just a setting I've missed. I've got an ASP.NET application which allows users to enter their username/password in various places (e.g. login, change password, change username etc..). When I logged in, the browser asked if I would like to store the user details. Usually, I click 'no', but this time I decided to click 'yes'. Now, certain textboxes in my form are prefilled with the username or password. Is it possible to remove these, as they sometimes appear in textboxes which shouldn't be prefilled. I tried setting AutoCompleteType=none and Text='' but it still gets prefilled. The textboxes don't have much in common, except the same CssClass and, for password boxes, TextMode=password. The names are different, although sometimes they include the word name (e.g. fullName, userName). Is there a way to stop the browser from filling certain textboxes?

谢谢

推荐答案

  <input type="text" name="Username" autocomplete="off">

你也可以把它放在 form 标签上.请注意,这并非在所有浏览器中都能始终如一地工作.

You can also put this on the form tag. Note this does not work consistently in all browsers.

这篇关于阻止浏览器用详细信息填充文本框的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆