防止文本框自动填充以前输入的值 [英] Prevent textbox autofill with previously entered values

查看:32
本文介绍了防止文本框自动填充以前输入的值的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有一些文本框控件的 asp 页面.

I have an asp page with some Textbox controls on it.

默认情况下,浏览器会为每个框建议先前输入的值.

By default, the browser will suggest previously entered values for each box.

我想防止某些文本框出现这种行为.

I'd like to prevent that behavior for some of the textboxes.

有没有办法在所有主要浏览器中可靠地做到这一点?

Is there a way to reliably do that across all major browsers?

我试过设置

AutoCompleteType="Disabled"

但这在 Firefox 中似乎没有效果.

But that seems to have no effect in Firefox.

这是我试图阻止的行为的图像.

Here is an image of the behavior I'm trying to prevent.

推荐答案

For firefox

For firefox

要么:

<asp:TextBox id="Textbox1" runat="server" autocomplete="off"></asp:TextBox>

或者来自 CodeBehind:

Or from the CodeBehind:

Textbox1.Attributes.Add("autocomplete", "off");

这篇关于防止文本框自动填充以前输入的值的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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