It will be more usefull to post page code and explain the problem using it.
Messages pop up for a reason.
They pop up, if user got to the page using POST request.
If form is in POST mode, then messages will surely appear if you refresh the page, because POST requests are used to make application perfrm some work, and it may be very bad to perform that work again. E.g., if you buy a new refrigerator, and hit refresh button at submission screen, you may get two delivered, when you actually need only one :)
Another option is GET request - you can set form submit mode to GET, and will get very long URL, but now messages on refresh. The drawback here is that you can save resulting url, and try to return the page many times, and the actions - such as fridge purchase will be performed again and again.