We know that in SharePoint, every page is associated with a master page. So we will not have a <Form> tag in it. So it becomes difficult to capture OnSubmit event. But the following post gives a very good explanation on how to achieve this.
To achieve the OnLoad event for the <Body> tag, use the following function call
Thanks to the following link