Javascript禁用/启用事件和$ addhandler [英] Javascript disable/enable event and $addhandler

查看:154
本文介绍了Javascript禁用/启用事件和$ addhandler的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我是JScript的新手,我正在寻找一种方法来在禁用或启用文本框时订阅该事件。我正在创建一个AJAX Extender控件,我通过JScript订阅:

I am fairly new to JScript and I am looking for a way to subscribe to the event when a textbox is disabled or enabled. I am creating a AJAX Extender Control and I am subscribing through the JScript:

$addhandler(textbox, 'EventName', Function);

我让它为点击,聚焦和模糊工作,但我会喜欢启用禁用工作。
是否有一个详尽的事件清单可以挂在那里?我试过谷歌搜索我所知道的一切。

I have it working for "click", "focus" and "blur", but I'd like to get enable disable working. Is there an exhaustive list of events that can be hooked into out there? I've tried googling everything I know.

推荐答案

我认为没有任何简单的解决方案。

I don't think there's any simple solution to this.

首先,您可能需要查看表单元素的两个属性:已禁用 readonly 。它们的行为都不同。

Firstly, there are two properties for form elements which you may want to look at: disabled and readonly. They both behave differently.

其次,没有特定的浏览器事件会在更改这些属性时触发。 PPK有很好的活动清单和浏览器支持。你可以来的最近的就是时髦的 DOMAttrModified DOMSubtreeModified - 但我认为这些并不适用于所有浏览器。

Secondly, there is no specific browser event that will trigger when those properties are changed. PPK has a good list of events and their browser support. The closest you can come is something like the funky DOMAttrModified or DOMSubtreeModified - but I don't think these work across all browsers.

这篇关于Javascript禁用/启用事件和$ addhandler的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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