Remember and restore form state using localStorage