I see, the default action for a <button> is to submit the form!  That's nasty.

If you make your onclick functions return false, would that cancel the click, and therefore the submit?