Problem double submit form

Problem double submit form

  

I have a form.

At

After click button Save, data will be save to DB, then redirect to list screen.

On

When redirect to list screen, I press F5

If click Resend, form detail will be submit again?

What's happening? and how to fix it?


Thanks

Hi Pham,

This is bog standard browser/http behaviour, and has been annoying since the very first version of Mosaic/Netscape. You can work around it, but I wouldn't do that, as you'd need it for each and every screen with a Submit.

Hi Pham,


Just like Kilian mentioned it is a browser behavior, as soon as you hit f5, the page get reloaded and whatever actions are written in the page executes. The question is why you have to do a refresh when you an action is already performed and you are back on expected page.

Stopping that may require additional code and it will be browser specific, so i think it will add more issues to manage moving forward.


Shashank...

Thank Kilian,

But If I change from Destination to End then F5 error no longer occurs.

I do not understand where I was wrong.

Hi Pham,

You are not wrong, that's how it works.

Solution

Hi,

If I may, I would like to expand the answers already given.

This behavior happens only when you have the following conditions:

a) The button/link have the "Submit" method set.
b) The redirection is done through a "Destination" set to a page through direct reference (see image below).

If you change the method of the button to "Ajax Submit", the behavior will be the "obvious expected" that will be the navigation to the new page without problems with the F5/Refresh, at least if you are coming from a "list page".

But if you need to use the "Submit" method, you can also solve this using an External URL instead of a direct navigation, like show below:

When you use a Navigation you do a server side redirection, that will have problems with the Submit.

Hope this helps.

Cheers,
Eduardo Jauch 

Solution

I agree with Eduardo.

I remember, in past I solved this problem by setting buttons method to Ajax Submit. 

Please try doing that.