Completed the storing of data on click of submit button.