for(i=1;i<=5;i++)
{....
window.form("a"+i).value="A"+i;
}
{....
window.form("a"+i).value="A"+i;
}
解决方案 »
- 一个php文件发送URL另一个接收(GET POST)
- window.operner为空或不是对象!!
- 请问jquery怎么模拟右键单击?
- javascript的一个选择的问题
- ◆鼠标移动时提示的代码
- FF不支持onreadystatechange事件怎么办?
- 谁能给份此类万年历的算法思想?http://www.eccxx.com/wnl.htm
- 利用javascript怎么做sleep功能?
- 如何用js检查文本框的内容是否合法????????????
- Jquery EasyUI编辑时combobox中required的问题
- 做过编辑器的大哥帮帮忙!!!(我想增加一个换行“<br>”的按钮要怎么做?)
- 为表格单元格onmouseover,onmouseout,onclick事件绑定了函数,如何在应用了click时只触发onclick而不触发onmouseout
{....
如:eval('window.form.a'+i).value=A+i
}
<html><head>
<meta http-equiv="Content-Language" content="en-us">
<meta http-equiv="Content-Type" content="text/html; charset=gb2312">
<title>New Page 1</title>
</head><body scroll=no onselect=alert() ><form name=form ><input name=a1>
<input name=a2>
<input name=a3>
<input name=a4>
<input name=a5>
<input type=button value=test onclick="testFun();">
</form></body></html>
<script language=javascript>
function testFun()
{
for(var i=1;i<=5;i++)
{
window.form("a"+i).value="A"+i;//最好不要把form的名字起得太特殊。
}}
</script>
或者:
getElementByName("a"+i);
所以总是没有读到值,请各位多指教
既然不是读的问题,而是创建的问题
什么不贴出创建的代码,
反而贴出读的代码
{
str='<br>';
if(!window.form.upcount.value)
window.form.upcount.value=1;
for(i=1;i<=window.form.upcount.value;i++)
str+='文件'+i+':<input type="file" name="file'+i+'" style="width:400" class="tx1"><br><br>';
window.upid.innerHTML=str+'<br>';
}
出于安全考虑,不可能对file-input赋值。
出于安全考虑,不可以对file-input赋值。