Ok, you've lost me on this. I understand where to put that block that you posted in the code tags but what's this bit?
Remove saveEntities(); from the onsubmit attribute of the form. Result: onsubmit="submitonce(this);"
Where is that? It isn't in script.js
Devious, treacherous, murderous, neanderthal, sub-human of the West.