peddel Posted February 9, 2009 Share Posted February 9, 2009 First my code was like this : Somewhere in my javascript code i call a function to disable some cells disableBlock2(true); Then this function is beïng called disabling the right fields. function disableBlock2(disableBool) { document.forms[0].B1A.disabled =disableBool; document.forms[0].B1B.disabled =disableBool; document.forms[0].B2A.disabled =disableBool; document.forms[0].B2B.disabled =disableBool; document.forms[0].uB1A.disabled=disableBool; document.forms[0].uB1B.disabled=disableBool; document.forms[0].uB2A.disabled=disableBool; document.forms[0].uB2B.disabled=disableBool; } I changed the code to a for - statement by using some arrays function disableBlock2(disableBool) { var rij = new Array('B1A','B1B','B2A','B2B','uB1A','uB1B','uB21','uB2B'); for(var i=0;i<rij.length;i++){ documents.forms[0].rij[i].disabled = disablebool; } } For a strange reason to me, the disabeling the fields doesnt work anymore. Anyone got a clue why? Im guessing somethings wrong in the use of my arrays ... Link to comment https://forums.phpfreaks.com/topic/144469-javascript-not-working-properly-anymore-cant-seem-to-find-the-reason/ Share on other sites More sharing options...
peddel Posted February 9, 2009 Author Share Posted February 9, 2009 The first thing i came up with was the following : The code does not replace rij with its value, so i kinda need to use a function to call the value, i guess ... Link to comment https://forums.phpfreaks.com/topic/144469-javascript-not-working-properly-anymore-cant-seem-to-find-the-reason/#findComment-758086 Share on other sites More sharing options...
Recommended Posts
Archived
This topic is now archived and is closed to further replies.