能用JS实现这样的功能吧?  谢谢了  麻烦了米分啊~

解决方案 »

  1.   


    <script>
    function check(obj){
    var a = obj.form.elements[obj.name];
    if(a.length) for(var i=0;i<a.length;i++) a[i].checked = false;
    obj.checked = true;
    }
    </script>
    <form>
    <input type="checkbox" name="xx" onclick="check(this);">
    <input type="checkbox" name="xx" onclick="check(this);">
    <input type="checkbox" name="xx" onclick="check(this);">
    <input type="checkbox" name="xx" onclick="check(this);">
    <input type="checkbox" name="xx" onclick="check(this);">
    </form>
      

  2.   

    关键是 把复选框的name 设置为相同的
      

  3.   

    <html>
    <head></head>
    <body>
    <form name="myForm">
    <input type="CheckBox" value="1" name="test" onclick="myFunction(this)">1<br>
    <input type="CheckBox" value="2" name="test" onclick="myFunction(this)">2<br>
    <input type="CheckBox" value="3" name="test" onclick="myFunction(this)">3<br><input type="text" name="mytext">
    </form>
    <script type="text/javascript">
      function myFunction(obj)
      {
      if(obj.checked)
      {
         for(i=0;i<document.myForm.test.length;i++)
         {
            if (document.myForm.test[i].value != obj.value)
            {
               document.myForm.test[i].checked = false; 
            }
         }
        document.myForm.mytext.value = obj.value;
       }
      } </script>
    </body>