Hello, whenever I try to call this function, web developer plugin for firefox gives me a message that says: "Error: addRow is not defined
Source File: http://localhost/xampp/Aptana/index.php
Line: 1"

Here is my code:

<script type="text/javascript">
var k = 7;
			function addRow()
			{
				var rowItem = document.createElement('input');
				newRow.setAttribute('type', 'text');
				newRow.setAttribute('name', 'item' + k);
				document.getElementById('myDiv').appendChild(rowItem);
				var rowPart = document.createElement('input');
				newRow.setAttribute('type', 'text');
				newRow.setAttribute('name', 'part' + k);
				document.getElementById('myDiv').appendChild(rowPart);
				k++;
			}
</script>
		<form>
		<input type="button" value="Add a Row" onclick="addRow()" />
		</form>

oops, had a bad name, this is solved now.

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.