I have a form and I'm trying to make it where if a person clicks on add new row or add new text input box that a new one appears on the same page. I'm looking to do this in javascript or php. But I also want to make it so that when a person creates a new input text box that a new name is given to it so that the processform.php page can retrieve the new values.
Here's is the following code that I have in javascript. It adds a new input text box when click, but how can I add it so that a predictive name is automatically given to each new input text box that is to be submitted?
<html>
<head>
<script type="text/javascript">
function insRow()
{
var x=document.getElementById('myTable').insertRow(0);
var y=x.insertCell(0);
y.innerHTML="<input type=text>";
}
</script>
</head>
<body>
<table id="myTable" border="0">
<tr>
<td></td><form action="processform.php" method="post"><input type=text name=A>
</tr>
<br />
</table>
<input type="button" onclick="insRow()" value="Insert row"><br>
<input type="submit" value="submit"/>
</form>
</body>
</html>
Also is there any other ways to do this? Thanks
This post has been edited by Information: 09 December 2008 - 07:56 PM


Help
This topic is locked
MultiQuote









