日期:2014-05-16  浏览次数:20480 次

复选框传值问题!
想实现这样的功能,调试了1天不行,请高手指点。
count.asp中,<input name="huohao" readonly onClick="JavaScript:window.open('listbook.asp,'','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=850,height=450,top=180,left=160');" style="width:120px" value="单击选择商品">
listbook.asp文件是一些产品的复选框 ,选择完成后点确认提交,本页关闭,把所选择的产品信息id,name等相关信息传给count.asp,这样的要怎么做呢
谢谢。

------解决方案--------------------

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<input name="huohao" id="huohao" readonly="readonly" onclick="window.open('13.html','','directorys=no,toolbar=no,status=no,menubar=no,scrollbars=yes,resizable=no,width=850,height=450,top=180,left=160');" style="width:120px" value="单击选择商品">
</body>
</html>


13.html

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
</head>

<body>
<input type="checkbox" name="product" value="1" />手机
<input type="checkbox" name="product" value="2" />像机
<input type="checkbox" name="product" value="3" />飞机
<input type="checkbox" name="product" value="4" />灰机
<input type="button" value="submit" id="btn" />
<script type="text/javascript">
document.getElementById('btn').onclick=function(){
var s=[];
var products=document.getElementsByTagName('input');
for(var i=0;i<products.length;i++){
if(products[i].type== 'checkbox' && products[i].checked){
s.push(products[i].value);
}
}
if(s.length>0){