You cannot effectively control the user's browser, nor should you try. This is the responsibility of the user. Allowing developers to take over creates security risks (remember 1999, when sites could open endless alert boxes and popups to prevent you from navigating away from their site?). Even if you managed to create a script that blocks the F5 button, browser vendors would be hard at work closing whatever bit of code you exploited to do it, and users (security-minded ones, anyway) would be mad at you. You need to handle this on the server-side, not the client-side.
Did you read the other thread that weedpacket linked to? The same concept applies. Your form needs to include a "token" so your scripts can recognize it. When a form is successfully processed, save the results. If the same form is submitted again, don't show an error: show the results from the first time.