Create workflow that will save the typed text in the DB every time user types.
If you refresh the page the text will be stored in the DB but your input will be empty. So you should indicate in the input a default value - reference to the text field in the DB. After that even if the page is refreshed the saved text will be displayed in the input.
Just create a data type for each user called “text backup”, and make it a text field.
Create a workflow on the page so that when the page refreshes you make changes to data type “text backup” and any text in your input is what gets entered into the field.
Then when the page loads you have a workflow to check for data in the “text backup” field, and if there is data there, that data gets populated to the input field.