Add beforeSubmit function.
Merge pull request #8 from kylerush/beforeSubmit

Add beforeSubmit function