PoppapumpJ
Programmer
I have a table with a hardcoded table and textboxes.
The user can click the "Add Row" button and a new row will be added to the table for them to input text.
Now the question is, why is the data collected in that newly created text box not passed during the submit.
For want it's worth, I am using ASP for ServerSide processing. Form method get is not allowed by comp policy. It has to be submitted via form.
I can access data of text boxes 1-5 because they are Hardcoded in the HTML.
Is there are way to pass the data in the created textboxes
Here is an example of what I am attempting:
[tt]
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script>
function addRow(){
//alert("got here"
var numRows = document.all.testTable.rows.length
var newRow = document.all.testTable.insertRow(numRows - 1)
newRow.insertCell(0)
newRow.insertCell(1)
newRow.insertCell(2)
newRow.cells(0).innerHTML = "test"
newRow.cells(1).innerHTML = "<INPUT type='text' name=text'" + (numRows-1) + "'>"
newRow.cells(2).innerHTML = " "
}
</script>
</HEAD>
<BODY>
<%
Response.Write Request.Form("text6"
%>
<FORM action=<%=Request.ServerVariables("URL"
%> method=post>
<TABLE ID="testTable" border = 1 cellspacing = 0 cellpadding=5>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text1></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text2></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text3></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text"name=text4></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text5></TD>
<td> </TD>
</TR>
<TR>
<td colspan=3 align=center><a href="#" onclick="javascript: addRow();">add reject reason</a></TD>
</TR>
</TABLE>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</form>
</BODY>
</HTML>
[/tt]
Is this even possible
The user can click the "Add Row" button and a new row will be added to the table for them to input text.
Now the question is, why is the data collected in that newly created text box not passed during the submit.
For want it's worth, I am using ASP for ServerSide processing. Form method get is not allowed by comp policy. It has to be submitted via form.
I can access data of text boxes 1-5 because they are Hardcoded in the HTML.
Is there are way to pass the data in the created textboxes
Here is an example of what I am attempting:
[tt]
<%@ Language=VBScript %>
<HTML>
<HEAD>
<META NAME="GENERATOR" Content="Microsoft Visual Studio 6.0">
<script>
function addRow(){
//alert("got here"
var numRows = document.all.testTable.rows.length
var newRow = document.all.testTable.insertRow(numRows - 1)
newRow.insertCell(0)
newRow.insertCell(1)
newRow.insertCell(2)
newRow.cells(0).innerHTML = "test"
newRow.cells(1).innerHTML = "<INPUT type='text' name=text'" + (numRows-1) + "'>"
newRow.cells(2).innerHTML = " "
}
</script>
</HEAD>
<BODY>
<%
Response.Write Request.Form("text6"
%>
<FORM action=<%=Request.ServerVariables("URL"
<TABLE ID="testTable" border = 1 cellspacing = 0 cellpadding=5>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text1></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text2></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text3></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text"name=text4></TD>
<td> </TD>
</TR>
<TR>
<TD>test</TD>
<TD><INPUT type="text" name=text5></TD>
<td> </TD>
</TR>
<TR>
<td colspan=3 align=center><a href="#" onclick="javascript: addRow();">add reject reason</a></TD>
</TR>
</TABLE>
<INPUT type="submit" value="Submit" id=submit1 name=submit1>
</form>
</BODY>
</HTML>
[/tt]
Is this even possible