terminal42 / contao-mp_forms

Real step separation in the form generator of the Contao Open Source CMS
25 stars 13 forks source link

multiple form submissions #38

Closed Metis77 closed 4 years ago

Metis77 commented 4 years ago

If the submit button "back" or "continue" is clicked fast multiple times, the form is successfully submitted just as many times. This happens until the server answers to the first click.

If on the last step, the form is also saved in Contao – if saving is setup. But in this case only the first "click" saves the form with complete data. On further clicks only the last step data is submitted.

To solve this for now, I temporary added some JS to disable the buttons after the first click.

form.querySelectorAll('button').forEach( el => {
            el.disabled = true;
        });

But I think this should also be catched somehow in the backend.

Toflar commented 4 years ago

I don‘t think there‘s anything we can do here. Also even if there was anything we could do, it would not be mp_forms responsibility because you can do it for any form generated with the Contao form generator (or without).