<html>
<head>
<title>投票</title>
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<link rel="stylesheet" href="style.css" type="text/css">
<!-- 加入处理函数-->
<script language="JavaScript">
var goodCount=0
var badCount=3
function good(a){
goodCount=goodCount+1
if(goodCount>3) goodCount=1
document.all("t"+goodCount).value=a.name
}
function bad(a){
badCount=badCount+1
if(badCount>6) badCount=4
document.all("t"+badCount).value=a.name
}
</script>
</head>
<!--修改这里,以下类似-->
          <tr bgcolor="eeeeee"> 
            <td width="70%">产品 1</td>
            <td width="15%"> 
              <input type="checkbox" name="aa1" value="checkbox" onClick=good(this)>
            </td>
            <td width="15%"> 
              <input type="checkbox" name="bb1" value="checkbox" onClick=bad(this)>
            </td>
          </tr>
          <tr bgcolor="eeeeee"> 
            <td width="70%">产品 2</td>
            <td width="15%">
              <input type="checkbox" name="aa2" value="checkbox" onChange=good(this)>
            </td>
            <td width="15%">
              <input type="checkbox" name="bb2" value="checkbox" onChange=bad(this)>
            </td>
          </tr>

解决方案 »

  1.   

    <html>
    <head>
    <title>投票</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel="stylesheet" href="style.css" type="text/css">
    </head>
    <script language="JavaScript">
    function calculate()
    {
    var sum,sum2;
    var chanpin=new Array("","","")
    var chanpin2=new Array("","","")
    sum=0;
    sum2=0
    for(i=0;i<document.all.aa.length;i++)
    {
    if (document.all.aa[i].checked==true)
    {sum=sum+1
    chanpin[sum-1]=document.all.aa[i].parentElement.parentElement.childNodes[0].innerText
    if (sum>3)
    {alert("超过三个了");
    return false;
    }
    }
    if (document.all.bb[i].checked==true)
    {sum2=sum2+1
    chanpin2[sum-1]=document.all.aa[i].parentElement.parentElement.childNodes[0].innerText
    if (sum2>3)
    {alert("超过三个了");
    return false;
    }
    }
    document.all.t1.value=chanpin[0]
    document.all.t2.value=chanpin[1]
    document.all.t3.value=chanpin[2]
    document.all.t4.value=chanpin2[0]
    document.all.t5.value=chanpin2[1]
    document.all.t6.value=chanpin2[2]
    }
    }
    </script>
    <body bgcolor="#FFFFFF" >  <p>&nbsp;</p><form name=VoteForm method='POST'>
      <table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" align="center">
        <tr>
        <td>
            <table border='0' cellpadding='3'rules=rows align="center" bordercolor="#000000" cellspacing='2'>
              <tr bgcolor="eeeeee"> 
                <td colspan="2" align="center">投票</td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较好的产品(1-3个)是:</td>
                <td width="208"> 
                  <p>              </p>
                  <p> t1 
                    <input type="text" name="t1" id="t1">
                    <br>
                    t2 
                    <input type="text" name="t2" id="t2">
                    <br>
                    t3 
                    <input type="text" name="t3" id="t3">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较差的产品(1-3个)是: </td>
                <td width="208"> 
                  <p> t4 
                    <input type="text" name="t4" id="t4">
                    <br>
                    t5 
                    <input type="text" name="t5" id="t5">
                    <br>
                    t6 
                    <input type="text" name="t6" id="t6">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td valign='bottom' align='center' width="187">您对我厂的服务情况:</td>
                <td width="208"> 
                  <select name="select">
                    <option value="0">-请选择-</option>
                    <option value="1">满意</option>
                    <option value="2">较满意</option>
                    <option value="3">一般</option>
                    <option value="4">不太满意</option>
                    <option value="5">不满意</option>
                  </select>
                </td>
              </tr>
              <tr bgcolor="#CCCCCC"> 
                <td valign='bottom' align='center' colspan="2" class="INPUT"> 
                  <input type='button' value='投票' name='B1' onClick="SubmitVote()">
                </td>
              </tr>      </table>
        </td>
      </tr>
    </table>  <br>
      <table border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center" width="322">
        <tr> 
          <td> 
            <table border=0 cellpadding=2 cellspacing=1 width="100%">
              <tr bgcolor="eeeeee"> 
                <td width="70%"><%if user_part = "Buyer" then %>经营企业<%else user_part = "Saler"%>医疗机构<%end if%>名称</td>
                <td width="15%">较好</td>
                <td width="15%">较差</td>
              </tr>
              <tbody> 
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 1</td>
                <td width="15%"> 
                  <input type="checkbox" name="aa1" id="aa"value="checkbox" >
                </td>
                <td width="15%"> 
                  <input type="checkbox" name="bb1"  id="bb"value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 2</td>
                <td width="15%">
                  <input type="checkbox" name="aa2"  id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb2" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 3</td>
                <td width="15%">
                  <input type="checkbox" name="aa3"  id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb3" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 4</td>
                <td width="15%">
                  <input type="checkbox" name="aa4"  id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb4" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 5</td>
                <td width="15%">
                  <input type="checkbox" name="aa5" id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb5" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 6</td>
                <td width="15%">
                  <input type="checkbox" name="aa6" id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb6" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 7</td>
                <td width="15%">
                  <input type="checkbox" name="aa7" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb7" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 8</td>
                <td width="15%">
                  <input type="checkbox" name="aa8" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb8" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 9</td>
                <td width="15%">
                  <input type="checkbox" name="aa9" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb9" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 10</td>
                <td width="15%">
                  <input type="checkbox" name="aa10" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb10" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor=#CCCCCC align="center"> 
                <td colspan=5> 
                  <input name=BUTTON  type=button value="选好了!" onClick="javascript:calculate();">
                  &nbsp;&nbsp; 
                  <input name=reset type=reset value="重选!" >
                </td>
              </tr>
              </tbody> 
            </table>
          </td>
        </tr>
      </table>
      <br><br><br>
    </form>
    </body>
    </html>
      

  2.   

    这样就可以了……………………………………………………………………………………………………<html>
    <head>
    <title>投票</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel="stylesheet" href="style.css" type="text/css">
    </head>
    <script language="JavaScript">
    function calculate()
    {
    var sum,sum2;
    var chanpin=new Array("","","")
    var chanpin2=new Array("","","")
    sum=0;
    sum2=0
    for(i=0;i<document.all.aa.length;i++)
    {
    if (document.all.aa[i].checked==true)
    {sum=sum+1
    chanpin[sum-1]=document.all.aa[i].parentElement.parentElement.childNodes[0].innerText
    if (sum>3)
    {alert("超过三个了");
    return false;
    }
    }
    if (document.all.bb[i].checked==true)
    {sum2=sum2+1
    chanpin2[sum2-1]=document.all.bb[i].parentElement.parentElement.childNodes[0].innerText
    if (sum2>3)
    {alert("超过三个了");
    return false;
    }
    }
    document.all.t1.value=chanpin[0]
    document.all.t2.value=chanpin[1]
    document.all.t3.value=chanpin[2]
    document.all.t4.value=chanpin2[0]
    document.all.t5.value=chanpin2[1]
    document.all.t6.value=chanpin2[2]
    }
    }
    </script>
    <body bgcolor="#FFFFFF" >  <p>&nbsp;</p><form name=VoteForm method='POST'>
      <table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" align="center">
        <tr>
        <td>
            <table border='0' cellpadding='3'rules=rows align="center" bordercolor="#000000" cellspacing='2'>
              <tr bgcolor="eeeeee"> 
                <td colspan="2" align="center">投票</td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较好的产品(1-3个)是:</td>
                <td width="208"> 
                  <p>              </p>
                  <p> t1 
                    <input type="text" name="t1" id="t1">
                    <br>
                    t2 
                    <input type="text" name="t2" id="t2">
                    <br>
                    t3 
                    <input type="text" name="t3" id="t3">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较差的产品(1-3个)是: </td>
                <td width="208"> 
                  <p> t4 
                    <input type="text" name="t4" id="t4">
                    <br>
                    t5 
                    <input type="text" name="t5" id="t5">
                    <br>
                    t6 
                    <input type="text" name="t6" id="t6">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td valign='bottom' align='center' width="187">您对我厂的服务情况:</td>
                <td width="208"> 
                  <select name="select">
                    <option value="0">-请选择-</option>
                    <option value="1">满意</option>
                    <option value="2">较满意</option>
                    <option value="3">一般</option>
                    <option value="4">不太满意</option>
                    <option value="5">不满意</option>
                  </select>
                </td>
              </tr>
              <tr bgcolor="#CCCCCC"> 
                <td valign='bottom' align='center' colspan="2" class="INPUT"> 
                  <input type='button' value='投票' name='B1' onClick="SubmitVote()">
                </td>
              </tr>      </table>
        </td>
      </tr>
    </table>  <br>
      <table border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center" width="322">
        <tr> 
          <td> 
            <table border=0 cellpadding=2 cellspacing=1 width="100%">
              <tr bgcolor="eeeeee"> 
                <td width="70%"><%if user_part = "Buyer" then %>经营企业<%else user_part = "Saler"%>医疗机构<%end if%>名称</td>
                <td width="15%">较好</td>
                <td width="15%">较差</td>
              </tr>
              <tbody> 
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 1</td>
                <td width="15%"> 
                  <input type="checkbox" name="aa1" id="aa"value="checkbox" >
                </td>
                <td width="15%"> 
                  <input type="checkbox" name="bb1"  id="bb"value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 2</td>
                <td width="15%">
                  <input type="checkbox" name="aa2"  id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb2" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 3</td>
                <td width="15%">
                  <input type="checkbox" name="aa3"  id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb3" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 4</td>
                <td width="15%">
                  <input type="checkbox" name="aa4"  id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb4" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 5</td>
                <td width="15%">
                  <input type="checkbox" name="aa5" id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb5" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 6</td>
                <td width="15%">
                  <input type="checkbox" name="aa6" id="aa" value="checkbox">
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb6" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 7</td>
                <td width="15%">
                  <input type="checkbox" name="aa7" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb7" id="bb" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 8</td>
                <td width="15%">
                  <input type="checkbox" name="aa8" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb8" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 9</td>
                <td width="15%">
                  <input type="checkbox" name="aa9" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb9" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 10</td>
                <td width="15%">
                  <input type="checkbox" name="aa10" id="aa" value="checkbox" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb10" id="bb" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor=#CCCCCC align="center"> 
                <td colspan=5> 
                  <input name=BUTTON  type=button value="选好了!" onClick="javascript:calculate();">
                  &nbsp;&nbsp; 
                  <input name=reset type=reset value="重选!" >
                </td>
              </tr>
              </tbody> 
            </table>
          </td>
        </tr>
      </table>
      <br><br><br>
    </form>
    </body>
    </html>
      

  3.   

    try this:<html>
    <head>
    <title>投票</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel="stylesheet" href="style.css" type="text/css">
    <script>
    function check()
    {
       var a=document.getElementsByName("aa")
       var chk=0
       var c=new Array()
       var j=0
       for(var i=0;i<a.length;i++)
       {
          if(a[i].checked)
          {
             chk++
             c[j]=a[i].value
             j++
          }
        }
       f1.t1.value=c[0]
       f1.t2.value=c[1]
       f1.t3.value=c[2]
       if(f1.t3.value=="undefined"){f1.t3.value=" "}
       if(f1.t2.value=="undefined"){f1.t2.value=" "}
       if(chk>3){alert("您最多只能选择3种产品")}
       
    }
    </script>
    </head><body bgcolor="#FFFFFF" >  <p> </p><form name="f1" name=VoteForm method='POST'>
      <table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" align="center">
        <tr>
        <td>
            <table border='0' cellpadding='3'rules=rows align="center" bordercolor="#000000" cellspacing='2'>
              <tr bgcolor="eeeeee"> 
                <td colspan="2" align="center">投票</td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较好的产品(1-3个)是:</td>
                <td width="208"> 
                  <p>              </p>
                  <p> t1 
                    <input type="text" name="t1" size="20">
                    <br>
                    t2 
                    <input type="text" name="t2" size="20">
                    <br>
                    t3 
                    <input type="text" name="t3" size="20">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较差的产品(1-3个)是: </td>
                <td width="208"> 
                  <p> t4 
                    <input type="text" name="t4" size="20">
                    <br>
                    t5 
                    <input type="text" name="t5" size="20">
                    <br>
                    t6 
                    <input type="text" name="t6" size="20">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td valign='bottom' align='center' width="187">您对我厂的服务情况:</td>
                <td width="208"> 
                  <select name="select">
                    <option value="0">-请选择-</option>
                    <option value="1">满意</option>
                    <option value="2">较满意</option>
                    <option value="3">一般</option>
                    <option value="4">不太满意</option>
                    <option value="5">不满意</option>
                  </select>
                </td>
              </tr>
              <tr bgcolor="#CCCCCC"> 
                <td valign='bottom' align='center' colspan="2" class="INPUT"> 
                  <input type='button' value='投票' name='B1' onClick="SubmitVote()">
                </td>
              </tr>      </table>
        </td>
      </tr>
    </table>  <br>
      <table border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center" width="322">
        <tr> 
          <td> 
            <table border=0 cellpadding=2 cellspacing=1 width="100%" height="297">
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="16"></td>
                <td width="15%" height="16">较好</td>
                <td width="15%" height="16">较差</td>
              </tr>
              <tbody> 
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 1</td>
                <td width="15%" height="20"> 
                  <input type="checkbox" name="aa" value="产品 1">
                </td>
                <td width="15%" height="20"> 
                  <input type="checkbox" name="bb1" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 2</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 2">
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb2" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 3</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 3">
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb3" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 4</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 4">
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb4" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 5</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 5">
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb5" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 6</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 6">
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb6" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 7</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 7">
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb7" value="checkbox">
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 8</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 8">
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb8" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 9</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 9" >
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb9" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%" height="20">产品 10</td>
                <td width="15%" height="20">
                  <input type="checkbox" name="aa" value="产品 10" >
                </td>
                <td width="15%" height="20">
                  <input type="checkbox" name="bb10" value="checkbox" >
                </td>
              </tr>
              <tr bgcolor=#CCCCCC align="center"> 
                <td colspan=5 height="21"> 
                  <input name=BUTTON  type=button value="选好了!" onclick="check()" >
                  &nbsp;&nbsp; 
                  <input name=reset type=reset value="重选!" >
                </td>
              </tr>
              </tbody> 
            </table>
          </td>
        </tr>
      </table>
      <br><br><br>
    </form>
    </body>
    </html>
      

  4.   

    ****************************
    完美解决方案如下,拷贝即可用,控件属性有修改
    ****************************<html>
    <head>
    <title>投票</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel="stylesheet" href="style.css" type="text/css">
    </head><body bgcolor="#FFFFFF" ><script>
    function putValue() //自动填写函数
    {
    var chName1="aa";
    var chName2="bb";
    var i,ii,j,jj; for(i=0,ii=0;i<10;i++)  //
    { if(document.VoteForm.aa[i].checked)
      {
      var tName1="t"+(ii+1);
      ii++;
      if (ii>3){alert('对不起,只能选择3项!');}
      else{
      document.all(tName1).value=document.VoteForm.aa[i].value;
      alert(document.VoteForm.aa[i].value); }
       } }
    for(j=0,jj=0;j<10;j++) //
    { if(document.VoteForm.bb[j].checked)
      {
      var tName2="t"+(jj+4);
      jj++;
      if (jj>3){alert('对不起,只能选择3项!');}
      else{
      document.all(tName2).value=document.VoteForm.bb[j].value;
      alert(document.VoteForm.bb[j].value); }
       } }
    for(i=0,j=0;i<10,j<10;i++,j++){
    if (document.VoteForm.aa[i].checked && document.VoteForm.bb[j].checked){
    if(document.VoteForm.aa[i].value=document.VoteForm.bb[j].value)
    {
    alert('不能认为一个产品又好又差~:)');
    for(t=1;t<=6;t++){ //将文本框置空!
    var tName3="t"+t;
    document.all(tName3).value="";
    }
    break;
    }
    }
    }
    }
    </script>  <p>&nbsp;</p><form name=VoteForm method='POST'>
      <table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" align="center">
        <tr>
        <td>
            <table border='0' cellpadding='3'rules=rows align="center" bordercolor="#000000" cellspacing='2'>
              <tr bgcolor="eeeeee"> 
                <td colspan="2" align="center">投票</td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较好的产品(1-3个)是:</td>
                <td width="208"> 
                  <p>              </p>
                  <p> t1 
                    <input type="text" name="t1">
                    <br>
                    t2 
                    <input type="text" name="t2">
                    <br>
                    t3 
                    <input type="text" name="t3">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较差的产品(1-3个)是: </td>
                <td width="208"> 
                  <p> t4 
                    <input type="text" name="t4">
                    <br>
                    t5 
                    <input type="text" name="t5">
                    <br>
                    t6 
                    <input type="text" name="t6">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td valign='bottom' align='center' width="187">您对我厂的服务情况:</td>
                <td width="208"> 
                  <select name="select">
                    <option value="0">-请选择-</option>
                    <option value="1">满意</option>
                    <option value="2">较满意</option>
                    <option value="3">一般</option>
                    <option value="4">不太满意</option>
                    <option value="5">不满意</option>
                  </select>
                </td>
              </tr>
              <tr bgcolor="#CCCCCC"> 
                <td valign='bottom' align='center' colspan="2" class="INPUT"> 
                  <input type='button' value='投票' name='B1' onClick="SubmitVote()">
                </td>
              </tr>      </table>
        </td>
      </tr>
    </table>  <br>
      <table border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center" width="322">
        <tr> 
          <td> 
            <table border=0 cellpadding=2 cellspacing=1 width="100%">
              <tr bgcolor="eeeeee"> 
                <td width="70%"><%if user_part = "Buyer" then %>经营企业<%else user_part = "Saler"%>医疗机构<%end if%>名称</td>
                <td width="15%">较好</td>
                <td width="15%">较差</td>
              </tr>
              <tbody> 
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 1</td>
                <td width="15%"> 
                  <input type="checkbox" name="aa" value="产品1" >
                </td>
                <td width="15%"> 
                  <input type="checkbox" name="bb" value="产品1" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 2</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品2" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品2" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 3</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品3" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品3" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 4</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品4" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品4" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 5</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品5" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品5" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 6</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品6" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品6" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 7</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品7" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品7" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 8</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品8" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品8" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 9</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品9" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品9" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 10</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品10" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品10" >
                </td>
              </tr>
              <tr bgcolor=#CCCCCC align="center"> 
                <td colspan=5> 
                  <input name=BUTTON  type=button value="选好了!"  onclick=putValue()>
                  &nbsp;&nbsp; 
                  <input name=reset type=reset value="重选!" >
                </td>
              </tr>
              </tbody> 
            </table>
          </td>
        </tr>
      </table>
      <br><br><br>
    </form>
    </body>
    </html>
      

  5.   

    【注意】:
    经测试:◆倚天剑的方法是错误的!
    ◆eyumumc(雨幕)的方法也不是完全正确,因为他没有判断客户选择了相同的checkbox的情况~
    ◆srj911()的方法完全错误!只有我的是可以符合要求的!特指正,谢谢大家批评~~~请楼主注意选择~~~
      

  6.   

    to HueVan(用分来砸我,快!) 
    大哥你懂不懂呀!我的怎么错了!
    我只作了“较好“的那一边,较坏的同理了!!
      

  7.   

    to HueVan(用分来砸我,快!) 
    你那个才是有问题呢!你看看两边各选3个然后有什么效果!
      

  8.   

    to: zhaoweiwei(if(轩辕剑^倚天剑)) ( 
    我的有问题吗?
    为了让楼主看的清楚,我特意alert出每个选项的值;
    两边各选三个不同的选项很正常,选项若有重复,会提示重选!
    有什么错误?
      

  9.   

    测试过的正常代码,再贴一次~!!!~看清楚!
    ***********************************************
    <html>
    <head>
    <title>投票</title>
    <meta http-equiv="Content-Type" content="text/html; charset=gb2312">
    <link rel="stylesheet" href="style.css" type="text/css">
    </head><body bgcolor="#FFFFFF" ><script>
    function putValue() //自动填写函数
    {
    var chName1="aa";
    var chName2="bb";
    var i,ii,j,jj;for(i=0,ii=0;i<10;i++)  //
    {
    if(document.VoteForm.aa[i].checked)
      {
    var tName1="t"+(ii+1);
    ii++;
      if (ii>3){alert('对不起,只能选择3项!');}
      else{
      document.all(tName1).value=document.VoteForm.aa[i].value;
      alert(document.VoteForm.aa[i].value); }
       }
    }for(j=0,jj=0;j<10;j++) //
    {
    if(document.VoteForm.bb[j].checked)
    {
    var tName2="t"+(jj+4);
    jj++;
    if (jj>3){alert('对不起,只能选择3项!');}
    else{
    document.all(tName2).value=document.VoteForm.bb[j].value;
    alert(document.VoteForm.bb[j].value); }
    }
    }
    for(i=0,j=0;i<10,j<10;i++,j++){
    if (document.VoteForm.aa[i].checked && document.VoteForm.bb[j].checked){
    if(document.VoteForm.aa[i].value=document.VoteForm.bb[j].value)
    {
    alert('不能认为一个产品又好又差~:)');
    for(t=1;t<=6;t++){ //将文本框置空!
    var tName3="t"+t;
    document.all(tName3).value="";
    }
    break;
    }
    }
    }
    }
    </script>  <p>&nbsp;</p><form name=VoteForm method='POST'>
      <table border="1" cellpadding="0" cellspacing="0" bordercolor="#000000" align="center">
        <tr>
        <td>
            <table border='0' cellpadding='3'rules=rows align="center" bordercolor="#000000" cellspacing='2'>
              <tr bgcolor="eeeeee"> 
                <td colspan="2" align="center">投票</td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较好的产品(1-3个)是:</td>
                <td width="208"> 
                  <p>              </p>
                  <p> t1 
                    <input type="text" name="t1">
                    <br>
                    t2 
                    <input type="text" name="t2">
                    <br>
                    t3 
                    <input type="text" name="t3">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="187">您认为较差的产品(1-3个)是: </td>
                <td width="208"> 
                  <p> t4 
                    <input type="text" name="t4">
                    <br>
                    t5 
                    <input type="text" name="t5">
                    <br>
                    t6 
                    <input type="text" name="t6">
                  </p>
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td valign='bottom' align='center' width="187">您对我厂的服务情况:</td>
                <td width="208"> 
                  <select name="select">
                    <option value="0">-请选择-</option>
                    <option value="1">满意</option>
                    <option value="2">较满意</option>
                    <option value="3">一般</option>
                    <option value="4">不太满意</option>
                    <option value="5">不满意</option>
                  </select>
                </td>
              </tr>
              <tr bgcolor="#CCCCCC"> 
                <td valign='bottom' align='center' colspan="2" class="INPUT"> 
                  <input type='button' value='投票' name='B1' onClick="SubmitVote()">
                </td>
              </tr>      </table>
        </td>
      </tr>
    </table>  <br>
      <table border="1" cellspacing="0" cellpadding="0" bordercolor="#000000" align="center" width="322">
        <tr> 
          <td> 
            <table border=0 cellpadding=2 cellspacing=1 width="100%">
              <tr bgcolor="eeeeee"> 
                <td width="70%"><%if user_part = "Buyer" then %>经营企业<%else user_part = "Saler"%>医疗机构<%end if%>名称</td>
                <td width="15%">较好</td>
                <td width="15%">较差</td>
              </tr>
              <tbody> 
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 1</td>
                <td width="15%"> 
                  <input type="checkbox" name="aa" value="产品1" >
                </td>
                <td width="15%"> 
                  <input type="checkbox" name="bb" value="产品1" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 2</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品2" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品2" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 3</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品3" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品3" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 4</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品4" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品4" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 5</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品5" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品5" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 6</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品6" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品6" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 7</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品7" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品7" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 8</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品8" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品8" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 9</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品9" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品9" >
                </td>
              </tr>
              <tr bgcolor="eeeeee"> 
                <td width="70%">产品 10</td>
                <td width="15%">
                  <input type="checkbox" name="aa" value="产品10" >
                </td>
                <td width="15%">
                  <input type="checkbox" name="bb" value="产品10" >
                </td>
              </tr>
              <tr bgcolor=#CCCCCC align="center"> 
                <td colspan=5> 
                  <input name=BUTTON  type=button value="选好了!"  onclick=putValue()>
                  &nbsp;&nbsp; 
                  <input name=reset type=reset value="重选!" >
                </td>
              </tr>
              </tbody> 
            </table>
          </td>
        </tr>
      </table>
      <br><br><br>
    </form>
    </body>
    </html>
      

  10.   

    以上各楼都是高手,都是高人。但现在如果我选产品的是在另一个窗口呢?即我设一个按钮“选择产品”弹出那个选产品的窗口,又怎么把那些值赋予母窗口中相对应的T1,T2,T3……T6呢??烦请以上各楼高手再次答复,不胜感激,高分相送!!!
      

  11.   

    添加一个窗口open.htm:<html>
    <head>
    <script>
    function add()
    {
       var a=document.getElementsByName("c1")
       var chk=0
       var c=new Array()
       var j=0
       for(var i=0;i<a.length;i++)
       {
          if(a[i].checked)
          {
             chk++
             c[j]=a[i].value
             j++
          }
        }   window.opener.f1.t1.value=c[0]
       window.opener.f1.t2.value=c[1]
       window.opener.f1.t3.value=c[2]
       if(window.opener.f1.t3.value=="undefined"){window.opener.f1.t3.value=" "}
       if(window.opener.f1.t2.value=="undefined"){window.opener.f1.t2.value=" "}
       if(chk>3){alert("您最多只能选择3种产品")}
    }
    </script>
    </head>
    <body>
    <form name="f2" action=post>
      <p>
      <input type="checkbox" name="c1" value="111">产品 1 </p>
      <p><input type="checkbox" name="c1" value="222">产品 2 </p>
      <p><input type="checkbox" name="c1" value="333">产品 3</p>
      <p><input type="button" value="按钮" name="B2" onclick="add()"></p>
    </form>
    </body>
    </html>主程序加入:<tr bgcolor="#CCCCCC"> 
                <td valign='bottom' align='center' colspan="2" class="INPUT"> 
                  <input type='button' value='投票' name='B1' onClick="SubmitVote()"> 
                  <input type='button' value='选择' name='B2' onclick="window.open('open.htm','')"></td>
              </tr>