diff --git a/common/js/common.js b/common/js/common.js index 30baa0633..e96177f3d 100644 --- a/common/js/common.js +++ b/common/js/common.js @@ -940,3 +940,26 @@ var Base64 = { } } + +/* select - option의 disabled=disabled 속성을 IE에서도 체크하기 위한 함수 */ +if(xIE4Up) { + xAddEventListener(window, 'load', activateOptionDisabled); + + function activateOptionDisabled(evt) { + var sels = xGetElementsByTagName('select'); + for(var i=0; i < sels.length; i++){ + sels[i].onchange = function() { + if(this.options[this.selectedIndex].disabled) { + if(this.options.length<=1) this.selectedIndex = -1; + else if(this.selectedIndex < this.options.length - 1) this.selectedIndex++; + else this.selectedIndex--; + } + } + if(sels[i].options[sels[i].selectedIndex].disabled) sels[i].onchange(); + + for(var j=0; j < sels[i].options.length; j++) { + if(sels[i].options[j].disabled) sels[i].options[j].style.color = '#CCC'; + } + } + } +}