Ok we're getting somewhere. Thanks for your hint on the SPAN tags. I was struggling on how to do that part...
So here's what we got.
1) you can create any number of rows by inputting a number.
a)
Problem: it only adds rows, it should reset everytime a new number is inserted. I have this function, and I feel that we need to call it everytime to "reset" the created rows back to 0, I'm just not sure how to implement it.
Code:
function removeRows(tr) {
tr.parentNode.removeChild(tr);
}
I tried adding it to the "addRows()" function before it creates any rows. I was thinking there should be a FOR loop that will take the current number of created rows, loop through the "removeRows()" function and delete each row. But not surprisingly, it didn't work.
2) It now properly displays how many rows created.
3) It now properly displays how many checkboxes have been selected.
a)
Problem: it only increments when you select a checkbox. If you deselect the checkbox, it actually increments, instead of decrement.
That's about it for now. One other question.
When I dynamically create the rows, how do I show the row count?
#
1
2
3
4
etc...
I created a SPAN ID called: row_count and tried to use the "i" increment value to update this like I normally would with PHP.
document.getElementById('row_count').innerHTML = i;
But doing so actually halted my script...