From 5f8bce506fe3a55f09b180fd4ad7c833a7aaa767 Mon Sep 17 00:00:00 2001 From: Sam Hemelryk Date: Thu, 29 Oct 2009 07:48:55 +0000 Subject: [PATCH] javascript MDL-20662 Commited patch to fix old_onload_focus, thanks Nigel for the patch :) --- lib/javascript-static.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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(); } } -- 2.39.5