是什么导致IE6不接受输入框中的文本?

发布于 2024-08-08 18:45:17 字数 963 浏览 0 评论 0原文

我有 2 个未禁用的输入框。当其中任何一个获得焦点时,不会显示光标,并且不会显示您输入的任何文本。这些元素附加了几个事件,但没有 js 错误。 IE7、IE8、FF2、FF3、Chrome 和 Safari 中会出现预期行为。

编辑: 以下是附加事件的代码示例。请注意,我正在使用 YUI 2。

YAHOO.util.Event.addListener(searchInputTop, 'focus', searchInputOnFocus);
YAHOO.util.Event.addListener(searchInputTop, 'blur', searchInputOnBlur);
searchInputOnBlur = function (e) 
{   
    if (e) 
    {   
        target = (e.target || e.srcElement);
    }   
    if (target && !target.value || target.value === "") 
    {   
        target.value = someDefault;
    }   
    target.className = 'someclass';
};  

searchInputOnFocus = function(e)
{   
    if (e) 
    {   
        target = (e.target || e.srcElement);
    }   
    if (target.value === currentDefaultText)
    {   
        target.value = ""; 
    }   
    target.className = "";
};

更新:

我不认为我的任何代码与它有任何关系。我在 IE6 中查看的任何具有输入框的页面都有相同的行为。我通过在带有 Win Xp service pack 3 的虚拟框下使用多个 IE 来运行 IE6。

I have 2 input boxes that are not disabled. When either gets focus no cursor is displayed and any text that you type in is not displayed. There are several events attached to these elements, but there are no js errors. Expected behavior occurs in IE7, IE8, FF2, FF3, Chrome, and Safari.

EDIT:
Here is a code example of the events being attached. Note that I am using YUI 2.

YAHOO.util.Event.addListener(searchInputTop, 'focus', searchInputOnFocus);
YAHOO.util.Event.addListener(searchInputTop, 'blur', searchInputOnBlur);
searchInputOnBlur = function (e) 
{   
    if (e) 
    {   
        target = (e.target || e.srcElement);
    }   
    if (target && !target.value || target.value === "") 
    {   
        target.value = someDefault;
    }   
    target.className = 'someclass';
};  

searchInputOnFocus = function(e)
{   
    if (e) 
    {   
        target = (e.target || e.srcElement);
    }   
    if (target.value === currentDefaultText)
    {   
        target.value = ""; 
    }   
    target.className = "";
};

UPDATE:

I don't think any of my code has anything to do with it. Any page that I view in IE6 that has input boxes has the same behavior. I'm running IE6 by using Multiple IE's under Virtual box with Win Xp service pack 3.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(3

—━☆沉默づ 2024-08-15 18:45:17

问题出在 MultipleIE 本身。

这里: IE6 表单:在输入字段上禁用焦点? (IE8以后的多个IE)

有人建议卸载MultipleIE,然后尝试通过Program Files访问文件(卸载后文件仍然存在)。

另一种方法是安装“Internet Explorer Collection”而不是 MultipleIE。

http://finalbuilds.edskes.net/iecollection.htm

希望这可以解决您的问题。

干杯

The problem is in MultipleIE itself.

Here: IE6 forms: focus disabled on input fields? (Multiple IEs after IE8)

someone suggested to uninstall MultipleIE and then try to access the files through Program Files (the files remain after the uninstall).

Another way to do it is installing "Internet Explorer Collection" instead of MultipleIE's.

(http://finalbuilds.edskes.net/iecollection.htm)

Hope this solves your issue.

Cheers

↘紸啶 2024-08-15 18:45:17

我也遇到过这个完全相同的问题。就我而言,我在哪个网站上都不重要,没有一个文本框可以让我输入文本......

I've had this exact same problem too. In my case it didn't even matter on which website I was, there wasn't a single textbox where I could enter text...

自演自醉 2024-08-15 18:45:17

一种可能的解释是,IE 正在拉伸一些透明元素,使其覆盖输入字段,这是由于其许多奇怪的 CSS 和布局错误之一。使用 DOM 检查器(例如 IE 开发人员工具栏)来查看是否有东西覆盖在它们上面。

(我已经链接到该产品的维基百科页面,因为与那些后面带有三十二位十六进制数字的奇怪的 microsoft.com URL 相比,它更有可能在同一 URL 停留一段时间. microsoft.com 上今天下载页面的链接位于底部。)

One likely explanation is that IE is stretching some transparent element such that it covers the input fields, due to one of its many weird CSS and layout bugs. Use a DOM inspector such as the IE Developer Toolbar to see if something is overlaid on them.

(I've linked to the Wikipedia page for the product as that's got a better chance of staying at the same URL for a while than one of those weird microsoft.com URLS with a thirty-two-digit hexadecimal number after it. The link to today's location for the download page on microsoft.com is at the bottom.)

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文