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

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

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