]> git.mjollnir.org Git - moodle.git/commitdiff
javascript MDL-20662 Commited patch to fix old_onload_focus, thanks Nigel for the...
authorSam Hemelryk <sam@moodle.com>
Thu, 29 Oct 2009 07:48:55 +0000 (07:48 +0000)
committerSam Hemelryk <sam@moodle.com>
Thu, 29 Oct 2009 07:48:55 +0000 (07:48 +0000)
lib/javascript-static.js

index 596104370d91d1e5aaf9335006a1b48a05d0d5c6..7e09d1a666383e96216005a42bfda3bef5be2f5c 100644 (file)
@@ -1162,7 +1162,7 @@ function focuscontrol(controlid) {
  * This function should be removed as soon as it is no longer used
  */
 function old_onload_focus(formid, controlname) {
-    if (document.forms[formid]) {
+    if (document.forms[formid] && document.forms[formid].elements && document.forms[formid].elements[controlname]) {
         document.forms[formid].elements[controlname].focus();
     }
 }