让Name一样就行.传过去的自动是1,3,2这种形式的
<input type=checkbox name=aa ...
<input type=checkbox name=aa ...
<input type=checkbox name=aa ...
<input type=checkbox name=aa ...
....楼主试一试

解决方案 »

  1.   

    <input type="checkbox" id="1" onclick="(this.checked==true)?saveIt(this.id):delIt(this.id)" name="check" />
    <input type="checkbox" id="2" onclick="(this.checked==true)?saveIt(this.id):delIt(this.id)" name="check" />
    <input type="checkbox" id="3" onclick="(this.checked==true)?saveIt(this.id):delIt(this.id)"name="check" />
    <script language="javascript">
    <!--
    var tempId = "";
    function saveIt(val)
    {
    tempId = tempId + val + ",";
    alert(tempId);
    }
    function delIt(val)
    {
    tempId = tempId.replace(val+",","");
    alert(tempId);
    }
    -->
    </script>