Ok heres the first page ....
<html>
<head>
<script>
function addRow1(){
var t = document.getElementById("someID")
var r = document.getElementById("someID").insertRow(t.rows.length - 1);
var c1 = r.insertCell(0)
var c2 = r.insertCell(1)
var c3 = r.insertCell(2)
var c4 = r.insertCell(3)
c1.innerHTML = "Random " + t.rows.length
c2.innerHTML = "Service"
c3.innerHTML = 12 + t.rows.length
c4.innerHTML = "0"
var cost = 0
var payment = 0
// Set the row attribute
r.setAttribute("id", document.getElementById('someID').rows.length)
var count=0;
for (i=1; i < t.rows.length -1; i++) {
for (j=0; j < t.rows.cells.length; j++) {
}
cost += parseInt(t.rows.cells[2].innerHTML)
payment += parseInt(t.rows.cells[3].innerHTML)
}
t.rows[t.rows.length - 1].cells[1].innerHTML = "£" + cost
t.rows[t.rows.length - 1].cells[2].innerHTML = "£" + payment
}
function completeMe(){
// Im completing the script with HTML entries into the table
var t = document.getElementById("someID")
var cost = ""
var payment = ""
for (i=1; i < t.rows.length -1; i++) {
for (j=0; j < t.rows.cells.length; j++) {
}
if(i > 1){
cost += "+"
payment += "+"
}
cost += parseInt(t.rows.cells[2].innerHTML)
payment += parseInt( t.rows.cells[3].innerHTML)
}
document.addForm.cost.value = cost
document.addForm.reciept.value = payment
document.addForm.submit()
}
</script>
</head>
<body>
<a href="javascript:addRow1()">Add</a>
<form name="addForm" method="post" action="save.asp">
<input type = "hidden" name = "cost">
<input type = "hidden" name = "reciept">
<table id="someID">
<tr>
<th>Name</th>
<th>Payment Type</th>
<th>Cost 1</th>
<th>Payment 1</th>
</tr>
<tr>
<td>BootCom</td>
<td>Works Completed</td>
<td>0</td>
<td>200</td>
</tr>
<tr>
<td colspan="2"> </td>
<td>0</td>
<td>200</td>
</tr>
</table>
</form>
<a href="javascript:completeMe()">Finish</a>
</body>
</html>
As you can probabaly see this page is up for lots of editing, just to make it do exactly what you want it to do. Use prompts to fill in the table values or use inputs.
Page 2 - Bung it all in a db / show it to user ... whatever you want it to do
<%
Dim input1
Dim input2
Dim intArrayLoop
input1 = split(request.form("cost"), "+")
input2 = split(request.form("reciept"), "+")
' Test to see if the js worked.
For intArrayLoop = 0 to uBound(input1)
response.write(intArrayLoop & " " & input1(intArrayLoop) & "<br />")
response.write(intArrayLoop & " " & input2(intArrayLoop) & "<br />")
Next
%>
There you go. Im now going to use this code to do something similar on my site. Happy coding