Note that there are some explanatory texts on larger screens.

plurals
  1. POOverriding the JS focus() method on IE 8 with ASPX and DEVExpress ...
    primarykey
    data
    text
    <p>I have this situation - on our ASPX site, uses DEVExpress, only on IE 8 (the original one, not IE 9 in mode IE 8) on the login page we have constantly an error:</p> <pre><code>Can't move focus to the control because it is invisible, not enabled, or of a type that does not accept the focus. </code></pre> <p>And so - I researched and found out that something is trying to focus something that is not visible. So I tried this solution - overriding the focus() method. Here is a short example HTML page:</p> <pre><code>&lt;!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt; &lt;html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en"&gt; &lt;head&gt; &lt;title&gt;AccuLynx&lt;/title&gt; &lt;script type="text/javascript"&gt; HTMLInputElement.prototype.focusCpy = HTMLInputElement.prototype.focus; HTMLInputElement.prototype.focus = function () { if( this.style.display != 'none' &amp;&amp; this.style.visibility != 'hidden' &amp;&amp; !this.disabled &amp;&amp; this.type != 'hidden' ) { HTMLInputElement.prototype.focusCpy.apply(this, arguments); } } &lt;/script&gt; &lt;/head&gt; &lt;body&gt; &lt;input type="submit" id="my_link" style="display:none;" value="dfsdfd" /&gt; &lt;script type="text/javascript"&gt; document.getElementById('my_link').focus(); &lt;/script&gt; &lt;/body&gt; &lt;/html&gt; </code></pre> <p>And then on the test page everything looks OK, but on the real site - not.</p> <p>The JS code is one of the first things that is executed - at the beginning of the second JS file (the first one is a JQuery plugin) - but it doesn't work.</p> <p>Any advice is appreciated.</p>
    singulars
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload