0

I have an HTML <select> in many places in my application, and I want to replace it with a custom drop down. I have created the custom control which will replace the HTML <select> on DOM ready.

Now, I want to implement something that will disable/re-enable my new control if there is a Javascript disabling/enabling the original control without doing any changes in the application elsewhere except within the control.

How is it that I can capture the event of the HTML select control being disabled or enabled and attach some code to that? Is there any other way to do it?

UPDATE: I got this thing working in IE7, Safari/Chrome but its not working in mozilla. Sample code in here http://jsfiddle.net/M73Wg/3/

Simranjit Singh
  • 592
  • 1
  • 4
  • 13

2 Answers2

0

This is a tricky one. Unfortunately (I believe) there is no straight answer. It comes down to: Yes you can do so by using JavaScripts DOMAttrModified event listener, but it's not cross-browser compatible.

Here are a few resources that might help you:

Community
  • 1
  • 1
Ayman Safadi
  • 11,502
  • 1
  • 27
  • 41
  • Thanks alot Ayman for giving a good direction, the first link i had seen but wanted some other way out than interval but i guess i'll have to go with it if i want my code to be crossbrowser.. – Simranjit Singh Dec 25 '11 at 21:16
0

Finally used timeout only http://jsfiddle.net/8EtJK/6/

DOMAttrModified is not working in mozilla

Regards, SJ

Simranjit Singh
  • 592
  • 1
  • 4
  • 13