<SCRIPT LANGUAGE="JavaScript">
function getName(){
var nameBox = document.test;
var name = nameBox.userName;
var l = name.length;
var j = 0;
var k = 0;
for (i = 0 ; i < l ; i++){
if(name[i].checked != true){
j++;//没被选种的个数
}
}
var left = new blankArray(j);//以没被选中的个数初始化一个数组left,此数组就是我们要使用的值
alert(left.length);
for (i = 0 ; i < l ; i++){
if(name[i].checked != true){
left[k++] = name[i].value//储值到数组中
}
}
for (i = 0; i <j ;i++){
alert(left[i]);//test
}
nameBox.submit();
}
function blankArray(n) {//新建数组的函数
for (var i=0; i < n; i++)this[i] = null;
this.length = n;
}
</Script>