Anyone got any ideas on how I would go about doing this?
You could attach an onsubmit listener to your form. Here is the quick n' dirty approach... place this script just before your closing </body> tag:
This is the quick n' dirty approach because it's assigning an event handler rather than an event listener. There can only be one event handler, though there can be any number of event listeners. However, there are cross browser incompatibilities with how to attach an event listener, so I will leave that as an exercise for you. Alternatively, you could use one of the popular frameworks like jQuery or YUI, which provide convenient methods for attaching listeners.