You can't access two different objects in one object reference. In essence your telling it I want "myvar" to equal 1 and then equal 2 and expecting "myvar" to be both 1 and 2.
var myvar = 1;
var myvar = 2;
if(myvar == 1) {
// do a very important task
}
if(myvar == 2) {
//do another very important task
}
I guarantee the first "if" will not happen, just like in your code.
enableElement(this.form.elements['box1'], this.form.elements['box2']);
Now, I personally think directly accessing the element by its id is better.
enableElement(document.getElementById('box1'), document.getElementById('box2'));