求助 ,提示undefined1 未定义 obj=eval(“(document.form2.score”+i+")");这样试试 解决方案 » 免费领取超大流量手机卡,每月29元包185G流量+100分钟通话, 中国电信官方发货 document.form2["score"+i]eval("document.form2.score"+i)document.getElementsByName("score"+i)[0]等等 改用数组好了,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> 楼上的是可以, 但因为我那个页面的限制,以及服务器端的要求, 只有用我那个方面写INPUT 所以还是不行, 求新方法 自己做了导航菜单时遇到个问题请教一下各位高手 谁能解释下下面代码?及其实现原理? jquery 嵌套循环 table 列排序 列锁定 求助html 高手请进 感激不禁 转贴:javascript中Object对象复制克隆方法clone [框架]调用 传值!问题! 怎样控制<input type="textfield">在客户端能够输入的字数? 一个新手的问题 javascript中如何判断是润年由此方法吗? 一个编辑器想实现的功能 跨站请求 急!
eval("document.form2.score"+i)
document.getElementsByName("score"+i)[0]
等等
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>