windows - Javascript runtime error using IE11 on Win7: Unable to set property 'disabled' of undefined or null reference -


i working on ie11 compatibility issues. code functional in compatibility mode optimize last ie5.

the affected code follows:

/*  * function sets specified button state in repair processing form  */ function setoperationbutton(buttonid, disabledstate, sourceimage, stylecursor) {     var buttonelement = document.frmrepairprocessing.elements[buttonid];     var sourceroot = '<%=helper.getapplicationurl()%>' + '/zimages/' + '<%=localestring%>' + '/';     buttonelement.disabled = disabledstate;     buttonelement.src = sourceroot + sourceimage;     buttonelement.style.cursor = stylecursor;    } 

so thinking code needs updated use getelementbyid, not quite sure how implement specific form.

please note: have tried document.forms().elements() , using .value well.

i believe acceptable use below code obtain buttonelement:

function setoperationbutton(buttonid, disabledstate, sourceimage, stylecursor) {     var buttonelement = document.getelementbyid(buttonid);     var sourceroot = '<%=helper.getapplicationurl()%>' + '/zimages/' + '<%=localestring%>' + '/';     buttonelement.disabled = disabledstate;     buttonelement.src = sourceroot + sourceimage;     buttonelement.style.cursor = stylecursor;    } 

Comments

Popular posts from this blog

Java 3D LWJGL collision -

spring - SubProtocolWebSocketHandler - No handlers -

methods - python can't use function in submodule -