obj=eval(“(document.form2.score”+i+")");这样试试

解决方案 »

  1.   

    document.form2["score"+i]
    eval("document.form2.score"+i)
    document.getElementsByName("score"+i)[0]
    等等
      

  2.   

    改用数组好了,input都用同名的,如下:<script>
    function show(){
      var num;
      eval("num=form1.score.length;");  for(var i=0;i<num;i++){
        alert(form1.score[i].value);
      }
    }
    </script><form name="form1">
    <input type="text" name="score"> 
    <input type="text" name="score"> 
    <input type="text" name="score"> 
    <input type="button" onclick="show()" value="显示值">
    </form>
      

  3.   

    楼上的是可以, 但因为我那个页面的限制,以及服务器端的要求, 只有用我那个方面写INPUT 所以还是不行, 求新方法