Unable to click in text input boxes on Internet Explorer
Ran into a nasty problem in Internet Explorer (I was using IE7, unsure if this affects other versions of IE) where I could not click into a text input in a form. The form element was not disabled, and I spent a lot of time making sure there were no CSS issues keeping me from clicking into the text input and entering text. Other elements in the form such as radio buttons and selectboxes were working, but all of the inputs of type text were dead.
Turns out that this was being caused by a bug in the dojo setSelectable function where I was set the setSelectable attribute to false for a div element that contained the form. Dojo claims that the behavior of setSelectable is browser independent, but as of version 1.2 this is clearly not the case. It turns out that if you apply setSelectable and set the value to false on an element that contains form elements inside of it, you will no longer be able to click into any of the form input elements of type text.
This only happens on IE, not Firefox or Safari. Even weirder is that if you then try to apply setSelectable directly to those text inputs to set the value back to true, you still can not put the focus back into those form elements. It appears that in IE that if any of the parent elements have the attribute set to false, the text inputs will inherite this value and it can't be overridden.
Clearly a bug in dojo. But a very odd one, and one that is hard to hunt down. So if you are using dojo and calling setSelectable and you find problems with your form elements, now you know what you need to do.
Turns out that this was being caused by a bug in the dojo setSelectable function where I was set the setSelectable attribute to false for a div element that contained the form. Dojo claims that the behavior of setSelectable is browser independent, but as of version 1.2 this is clearly not the case. It turns out that if you apply setSelectable and set the value to false on an element that contains form elements inside of it, you will no longer be able to click into any of the form input elements of type text.
This only happens on IE, not Firefox or Safari. Even weirder is that if you then try to apply setSelectable directly to those text inputs to set the value back to true, you still can not put the focus back into those form elements. It appears that in IE that if any of the parent elements have the attribute set to false, the text inputs will inherite this value and it can't be overridden.
Clearly a bug in dojo. But a very odd one, and one that is hard to hunt down. So if you are using dojo and calling setSelectable and you find problems with your form elements, now you know what you need to do.
| Rating: | 100% positive, 2 total Votes |
| Categories: | javascript dojo programming coding internet explorer |
| Added: | on Dec 09, 2008 at 10:49 am |
| Added By: | Marcos84 |
| Searches: | text element form dojo input |

