form.all["r1"].value=""
改为
form.all["r1"].value==""

解决方案 »

  1.   

    form.all["r1"].value=""
    改为
    form.all["r1"].value==""
    改了后,还是没用呀
      

  2.   

    <script  language="javascript">
    function checkform(form){
    var length=form.all.length;

    for(i=0;i<length;i++){

    var radiobox=form.all[i];

     if(radiobox.type=="radio"){
        if(radiobox.checked==false)
        {
           window.alert("aa");
           break;
           }
       }
      }
    return false;
    }
    </script>
      

  3.   

    form.all["r1"].value  这个 不是对象  他是个数组~:)
      

  4.   

    <script  language="javascript">
    function checkform(form){
    var bb=document.getElementsByName("r1");
    for(var i=0;i<bb.length;i++){
    if(bb[i].checked){
    alert(bb[i].name+"被选中");
    }
    }
    }
    </script><form action="#" method="post" id="form1" onSubmit="return checkform(this)">
    <table>
    <tr>
    <td><input type="radio" name="r1" value="1"> <input type="radio" name="r1" value="2"></td>
    <td><input type="submit" name="submit"></td>
    </tr>
    </table>
    </form>