Jump to content

Javascript not working properly anymore, cant seem to find the reason..


peddel

Recommended Posts

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 ...

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.