in reply to Executing a function on submit

Javascript in the browser is the answer. There are a number of ways, but probably you want an onClick event on the button that does something like document.write("tada")

Note: there are several ways to detect events that can trigger Javascript, and there are a mulititude of ways to get content written to the browser. Now, if you want to get cross-browser compliant, it gets trickier.