What I might do is use AJAX for the first point; when the data is posted and your server-side code has dealt with it, return back a boolean that your JavaScript can then use to reset the form. This will prevent the form retaining its data after a page refresh or from the user clicking the back button.
Not sure you really have to worry about point 2 to be honest. If you have a form that a user fills in and it retrieves data via an AJAX call, and the user hits refresh, well yeah, it's going to clear what was in the fields or disrupt it in other ways. But I don't think there's much you can do about that. I guess you could store the values in a session and do a check when the page loads if the session exists, etc., but why go through all that trouble? It just seems like a lot of extra work for something that's never intended to happen. What if the user closes the browser tab? Or clicks the X button? Or a million other things.
Or maybe I'm misinterpreting the situation entirely.