How to retain the form state including the input data after the submit button is clicked?