Is there a way for me to pass the value of a hidden variable to another page from within a javascipt function? The value of this hidden variable is dependent on the counter inside my javascript function.

function cntCheck(frmView){
var num=0;
for(var i=0; i< document.frmView.length; i++) {
fldObj = document.frmView.elements[i];
if(fldObj.checked) {
num++;
}
}
document.frmView.hiddenvariablename.value = num;
}

I tried using the following statement before closing the function above:

document.frmname.hiddenvariablename.value = something

However, I can't get it to work.

Any help will be greatly appreciated! Thanks in advance!