-
Bug
-
Resolution: Fixed
-
Low
-
1.4
-
None
-
Windows XP Pro, Tomcat 5.0, MySQL 4.1
When re-editing a blog post, the "News Title" field is disabled. This causes IE 6.0 to throw a JavaScript error. We traced it back to the function placeFocus() in "decorators/effects.js". The function placeFocus() is called in the body's onload event and performs the following:
function placeFocus() {
[...]
var currSet=document.forms[i].elements;
[...]
if (currSet[j].type=='text' || currSet[j].type=='password' || currSet[j].type=='textarea')
[...]
}
When an element is in "disabled" mode, the focus method is not applicable for IE. We tried it in Firefox as well but no error was thrown there, so this is simply IE not accepting the focus() method for disabled form elements.
To prevent the error from being shown, we modified the placeFocus() function such as:
function placeFocus() {
[...]
if ((currSet[j].type=='text' || currSet[j].type=='password' || currSet[j].type=='textarea') && !currSet[j].disabled){ currSet[j].focus(); stopNow=true; break; }
[...]
}
We needed to fix this because the error was preventing some other custom JavaScript code we have from running (we are working on a WYSIWYG add-on... stay tuned).
-George
Already fixed