<SCRIPT language=javascript>
function openbag(id) {
cURL = "view.asp?cpbm="+id;
cURL += "&total="+total.value;
//alert(cURL);
window.open(cURL);

</script><td width="164" height="25"><font color="#cc0033"><b>数量:</b></font> 
   <input type="text" name="total" size="3" value="1" id="total">
</td><a href='javascript:openbag(<%=rs("Product_Id")%>)'> <img src="images/goumai.gif" border="0"></a> :_)

解决方案 »

  1.   

    还是不行,补充一句我的文本框不是在表单里面的,能否把total.value当左参数传给openbag,因为
    script语句我是写在一个inc文件里面被其他文件共用的
    如果这样写的话是不是这样写
    <SCRIPT language=javascript>
    function openbag(id,totals) {
    cURL = "view.asp?cpbm="+id;
    cURL += "&totals="+totals;
    //alert(cURL);
    window.open(cURL);
    } <a href='javascript:openbag(<%=rs("Product_Id")%>,total.value)'> <img src="images/goumai.gif" border="0"></a> 
    </script>
      

  2.   

    <a href='javascript:openbag(<%=rs("Product_Id")%>,document.all(total).value)'> <img src="images/goumai.gif" border="0"></a> 
    </script>
      

  3.   

    还是不行,为什么呢?根本访问不到total
      

  4.   

    <SCRIPT language=javascript>
    function openbag(id) {
    cURL = "view.asp?cpbm="+id;
    cURL += "&total="+document.all.total.value;
    //alert(cURL);
    window.open(cURL);

    </script><td width="164" height="25"><font color="#cc0033"><b>数量:</b></font> 
       <input type="text" id="total" size="3" value="1" id="total">
    </td><a href='javascript:openbag(<%=rs("Product_Id")%>)'> <img src="images/goumai.gif" border="0"></a>