- 论坛徽章:
- 0
|
下列是我的code:
我只有一个checkbox时,为何无法获取document.forms["getcode"].elements["bk[]"].length的值,有两个时就正常!
求助各位帮忙!!!!
<script language="javascript">;
function pickup()
{
var bstring="";
for(var i = 0; i < document.forms["getcode"].elements["bk[]"].length; i++)
{
if(document.forms["getcode"].elements["bk[]"].checked)
{
alert(document.forms["getcode"].elements["bk[]"].value);
if(bstring==""
bstring=document.forms["getcode"].elements["bk[]"].value;
else
bstring=bstring+","+document.forms["getcode"].elements["bk[]"].value;
}
}
if(window.opener && !window.opener.closed)
{
window.opener.document.pitem.barcode.value = bstring;
//window.close();
}
}
</script>; |
|