From: Sam Hemelryk Date: Thu, 29 Oct 2009 07:48:55 +0000 (+0000) Subject: javascript MDL-20662 Commited patch to fix old_onload_focus, thanks Nigel for the... X-Git-Url: http://git.mjollnir.org/gw?a=commitdiff_plain;h=5f8bce506fe3a55f09b180fd4ad7c833a7aaa767;p=moodle.git javascript MDL-20662 Commited patch to fix old_onload_focus, thanks Nigel for the patch :) --- diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 596104370d..7e09d1a666 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -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(); } }