日期:2014-05-16  浏览次数:20592 次

急。JS高手进。
<script   language= "javascript ">
function   cha(selv)
{
var   b= " ";
//var   chav=document.getElmentById( "chav ").value;
for(var   t=1;t <=selv;t++)
{
b=b+ " <input   id= 'selvi '   name= 'selvi '   type= 'text '   size=38> &nbsp;&nbsp; <input   name= 'selID '   id=selID   type= 'text '   size=5> <br> ";
}
sel.innerHTML=b;
//chav.value=selv;
//alert(chav.value);
}

</script>
<form   action= " "   medthod=post>
<input   type=hidden   name=chav   id=chav>
<span   id=sel   name=sel> </span>
</form>

这个JS生成的TEXT值可以获取的吗?我提交之后
response.write   request.Form( "selvi ")
打印出来是空值。。。什么原因啊?
还有解释语句的语法有错吗》?

------解决方案--------------------
下面是我改的代码,我不知道你的页面代码是怎么写的.不可能没有触发cha()这个函数吧.

<html>
<head>
<script language= "javascript ">
function cha(selv)
{
var b= " ";
//var chav=document.getElmentById( "chav ").value;
for(var t=1;t <=selv;t++)
{
b=b+ " <input id= 'selvi ' name= 'selvi ' type= 'text ' size=38> &nbsp;&nbsp; <input name= 'selID ' id=selID type= 'text ' size=5> <br> ";
}
sel.innerHTML=b;
//chav.value=selv;
//alert(chav.value);

}


</script>

</head>
<body onLoad= "cha(1) ">
<form action= " " medthod= "get ">
<input type=hidden name=chav id=chav>

<span id=sel name=sel> </span>
<input type= "submit " value= "check " >
</form>

</body>
</html>