js 获取HTML控件的文本 在线等
<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Default3.aspx.cs" Inherits="Default3" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>JS添加文本框</title>
<script type="text/javascript">
var nText=1;
function expand()
{
nText ++;
var str = '选项' + nText +' <input type="text" name="File" style="width: 300px"/><BR> '
if(nText > 8)
document.all.button1.style.display= "none";
else
{ file.insertAdjacentHTML('BeforeEnd',str);}
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
选项1
<input type="text" name="File" style="width: 300px"/>
<div id="file"></div><br />
<input type="button" value="添加" onClick="expand();" id="button4" style="display:" runat="server"></div>
</form>
</body>
</html>
以上这段代码实现了JS动态添加文本框,
现在我行在后台得到各个文本框的值。 。 NAME都一样的 请问可以如何实现。 分不够明天再加
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
<title>JS添加文本框</title>
<script type="text/javascript">
var nText=1;
function expand()
{
nText ++;
var str = '选项' + nText +' <input type="text" name="File" style="width: 300px"/><BR> '
if(nText > 8)
document.all.button1.style.display= "none";
else
{ file.insertAdjacentHTML('BeforeEnd',str);}
return false;
}
</script>
</head>
<body>
<form id="form1" runat="server">
<div>
选项1
<input type="text" name="File" style="width: 300px"/>
<div id="file"></div><br />
<input type="button" value="添加" onClick="expand();" id="button4" style="display:" runat="server"></div>
</form>
</body>
</html>
以上这段代码实现了JS动态添加文本框,
现在我行在后台得到各个文本框的值。 。 NAME都一样的 请问可以如何实现。 分不够明天再加
...全文


