document.Form[n].elements
表单中包括那些可用元素(如textbox,texteare,checkbox etc.)?!!!!

解决方案 »

  1.   

    我有个思路,你看有没有用!定义一个数组(curArray(maxQus)),最大下标和试题数目一样,一一对应!!每答一道题,就给相应的curArray(cur) = '1' ,未答或取消则curArray(cur) = '0'最后来检查该数组中那些是'0'就OK了~~~~~~~~~
      

  2.   

    你的题目的HTML的代码没发上来 谁知道怎么你是怎么判断的啊
    问问题你得把意思表达完整啊烦人
      

  3.   

    呵呵~~,给你我做考试系统时的思路,以单选为例:
    定义一个全局变量s=""(一个hidden的input也行)
    然后,点击一组radio的时候,if(s.indexOf(","+题号+",")==-1)s+=","+题号+","
    然后点击提交的时候,s=s.replace(/^,/i,"").replace(/,$/i,"").split(","),就会把所有做过的题的题号放入s数组,然后定一个另一个全局变量s1=",题1,题2,...",然后从s1中去掉s的所有元素,剩下的就是没做的:)
      

  4.   

    给你段例子看看<form name="form1">
      1、<input type="radio" name="test1">Y<input type="radio" name="test1">N<br>
      2、<input type="radio" name="test2">Y<input type="radio" name="test2">N<br>
      3、<input type="radio" name="test3">Y<input type="radio" name="test3">N<br>
      4、<input type="radio" name="test4">Y<input type="radio" name="test4">N<br>
      5、<input type="radio" name="test5">Y<input type="radio" name="test5">N<br>
      6、<input type="radio" name="test6">Y<input type="radio" name="test6">N<br>
      7、<input type="radio" name="test7">Y<input type="radio" name="test7">N<br>
      8、<input type="radio" name="test8">Y<input type="radio" name="test8">N<br>
      9、<input type="radio" name="test9">Y<input type="radio" name="test9">N<br>
      10、<input type="radio" name="test10">Y<input type="radio" name="test10">N<br>
      11、<input type="radio" name="test11">Y<input type="radio" name="test11">N<br>
      12、<input type="radio" name="test12">Y<input type="radio" name="test12">N<br>
      13、<input type="radio" name="test13">Y<input type="radio" name="test13">N<br>
      14、<input type="radio" name="test14">Y<input type="radio" name="test14">N<br>
      15、<input type="radio" name="test15">Y<input type="radio" name="test15">N<br>
      16、<input type="radio" name="test16">Y<input type="radio" name="test16">N<br>
      17、<input type="radio" name="test17">Y<input type="radio" name="test17">N<br>
      18、<input type="radio" name="test18">Y<input type="radio" name="test18">N<br>
      19、<input type="radio" name="test19">Y<input type="radio" name="test19">N<br>
      20、<input type="radio" name="test20">Y<input type="radio" name="test20">N<br>
      <button onclick="eyun()">Check</button>
    </form1>
    <script language=JavaScript>
    var s="";
    function form1.onclick()
      {var o=event.srcElement;
       if(o.type=="radio")
         if(s.indexOf(","+o.name.replace(/test/ig,"")+",")==-1)
           s+=","+o.name.replace(/test/ig,"")+",";
      }
    function eyun()
      {var s1=",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,";
       var s2=s.replace(/^,/i,"").replace(/,$/i,"").split(",")
       var l=s.length;
       for(var i=0;i<=l;i++)
         s1=s1.replace(eval("/,"+s2[i]+",/ig"),",");
       s1=s1.replace(/^,/i,"").replace(/,$/i,"").replace(/,/ig,"、");
       alert("第"+s1+"题未完成!")
    }
    </script>
      

  5.   

    var w = "有如下题没做:"
    for(var i=0;i<100;i++){
    if(document.forms[0].elements[i*5].checked=true)w+=",i";
    }document.write(w.fontcolor("#ff0000");
    是不是还太复杂了  还要简单一点
      

  6.   

    纯单选题的话,还能这样:
    <form name="form1">
      1、<input type="radio" name="test1">Y<input type="radio" name="test1">N<br>
      2、<input type="radio" name="test2">Y<input type="radio" name="test2">N<br>
      3、<input type="radio" name="test3">Y<input type="radio" name="test3">N<br>
      4、<input type="radio" name="test4">Y<input type="radio" name="test4">N<br>
      5、<input type="radio" name="test5">Y<input type="radio" name="test5">N<br>
      6、<input type="radio" name="test6">Y<input type="radio" name="test6">N<br>
      7、<input type="radio" name="test7">Y<input type="radio" name="test7">N<br>
      8、<input type="radio" name="test8">Y<input type="radio" name="test8">N<br>
      9、<input type="radio" name="test9">Y<input type="radio" name="test9">N<br>
      10、<input type="radio" name="test10">Y<input type="radio" name="test10">N<br>
      11、<input type="radio" name="test11">Y<input type="radio" name="test11">N<br>
      12、<input type="radio" name="test12">Y<input type="radio" name="test12">N<br>
      13、<input type="radio" name="test13">Y<input type="radio" name="test13">N<br>
      14、<input type="radio" name="test14">Y<input type="radio" name="test14">N<br>
      15、<input type="radio" name="test15">Y<input type="radio" name="test15">N<br>
      16、<input type="radio" name="test16">Y<input type="radio" name="test16">N<br>
      17、<input type="radio" name="test17">Y<input type="radio" name="test17">N<br>
      18、<input type="radio" name="test18">Y<input type="radio" name="test18">N<br>
      19、<input type="radio" name="test19">Y<input type="radio" name="test19">N<br>
      20、<input type="radio" name="test20">Y<input type="radio" name="test20">N<br>
      <button onclick="eyun()">Check</button>
    </form1>
    <script language=JavaScript>
    var s1=",1,2,3,4,5,6,7,8,9,10,11,12,13,14,15,16,17,18,19,20,";
    function form1.onclick()
      {var o=event.srcElement;
       if(o.type=="radio")
         s1=s1.replace(eval("/,"+o.name.replace(/test/ig,"")+",/i"),",");
      }
    function eyun()
      {s1=s1.replace(/^,/i,"").replace(/,$/i,"").replace(/,/ig,"、");
       alert("第"+s1+"题未完成!")
    }
    </script>
      

  7.   

    dhtkhnt(阿和) 我觉得用数组的方法可能行,把做过的客观题的题号记录在一个数组中,数组元素的下标与题号相同,检查答题的时候就先检查数组,哪一个元素的值为0,那哪一题就还没有做。这样循环一次就能把客观题查找完了。不会像原来的,有多少个选项,就要循环多少次。