it fixes the issue RequestDispatcher will keep request attributes and forward page with same request, that is why if you refresh page controller gets same request and process it again. Use SendRedirect instead.
Cannot stop refresh after form submit jquerymobile
I think the issue was by ths following , I am learning to write web apps at the moment and have built a small calculator. The problem is that the page refreshes after I press one of the form buttons. , Try adding return false; to your onClick event:
onclick="addgst(this.form); return false"
To stop form submit on every refresh after one submit in codeigniter
I wish this helpful for you After form submission , any number of refresh is storing the data that many times in the db. ie. !empty($_POST) is always true after on submission. , Just do a redirect(); to the same age after the insert function.
I hope this helps you . Preventing the default on the submit button should theoretically stop form submission—but: there is no submit event for an input button. If you listen to click, that will work, but only partially because... there might be other confounding factors that is interfering with this, i.e. other keystrokes or user interactions that causes the form to be submitted.