Cleaned up javascript form submitting a little by adding a submit event handler on the form when the document is ready.