From c0056e22270163bc7d627f72685c9f262b13b140 Mon Sep 17 00:00:00 2001 From: jamiesensei Date: Fri, 13 Jul 2007 08:14:37 +0000 Subject: [PATCH] fix for MDL-10440 IE7 and IE6 on win xp error when changing "disable" state of "Start date" --- lib/javascript-static.js | 24 +++++++++++++----------- 1 file changed, 13 insertions(+), 11 deletions(-) diff --git a/lib/javascript-static.js b/lib/javascript-static.js index 1d9b0915ecf..739355dce10 100644 --- a/lib/javascript-static.js +++ b/lib/javascript-static.js @@ -137,16 +137,18 @@ function lockoptionsallsetup(formid) { if (master == undefined) { continue; } - master.onclick = function() {return lockoptionsall(this.form.getAttribute('id'));}; - master.onblur = function() {return lockoptionsall(this.form.getAttribute('id'));}; - master.onchange = function() {return lockoptionsall(this.form.getAttribute('id'));}; + master.formid = formid; + master.onclick = function() {return lockoptionsall(this.formid);}; + master.onblur = function() {return lockoptionsall(this.formid);}; + master.onchange = function() {return lockoptionsall(this.formid);}; } for (var i = 0; i < form.elements.length; i++){ var formelement = form.elements[i]; if (formelement.type=='reset') { - formelement.onclick = function() {this.form.reset();return lockoptionsall(this.form.getAttribute('id'));}; - formelement.onblur = function() {this.form.reset();return lockoptionsall(this.form.getAttribute('id'));}; - formelement.onchange = function() {this.form.reset();return lockoptionsall(this.form.getAttribute('id'));}; + formelement.formid = formid; + formelement.onclick = function() {this.form.reset();return lockoptionsall(this.formid);}; + formelement.onblur = function() {this.form.reset();return lockoptionsall(this.formid);}; + formelement.onchange = function() {this.form.reset();return lockoptionsall(this.formid);}; } } return lockoptionsall(formid); @@ -432,14 +434,14 @@ function insertAtCursor(myField, myValue) { /* - Call instead of setting window.onload directly or setting body onload=. - Adds your function to a chain of functions rather than overwriting anything - that exists. -*/ + Call instead of setting window.onload directly or setting body onload=. + Adds your function to a chain of functions rather than overwriting anything + that exists. +*/ function addonload(fn) { var oldhandler=window.onload; window.onload=function() { if(oldhandler) oldhandler(); - fn(); + fn(); } }