求助 ,提示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 所以还是不行, 求新方法 ext js 如何做多国语言 分页实现复选框的选择 Extjs gridpanel的单元格的数据怎么居中显示? 怎么用window.open()弹出窗口而不显示黄色提示条 javascript对于这样的问题怎样去判断? 有没有不用window.open来让窗口全屏显示的方法? javascript的级联菜单的问题 使页面加载时就刷新页面的代码怎么写? 用JS写了个TYPING TEST欢迎测试! weiwei,麻烦你了! 一个编辑器想实现的功能 跨站请求 急!
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>