Hello, I want for the user to be able to click on a button that lets them add a <tr> full of <td>'s and <input>'s in the <td> tags. So I have code like:

<script type="text/javascript">
function addRow()
{
// Insert a row too the table with td's and input's
}
</script>

<table>
<tr>
<td><input type="text" name="part1" /></td><td><input type="text" name="price1" /></td>
</tr>
<tr>
<td><input type="text" name="part2" /></td><td><input type="text" name="price2" /></td>
</tr>
</table>
<form>
<input type="button" onclick="addRow();" value="Add a Row" />
</form>

so after the last </tr> tag, I want to add that row, how would I do this? The problem I have been running into is that there is no way to add closing tags that I have found, so it is hard to control things that need closing tags like a table.

solved this yesterday, just used some DOM stuff.

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.