When I submit the form, everything is ok and once the submission is successful y use:
app.views.main.router.navigate("/");
to go back.
The problem is that if I access the same page again, and submit the form, it will submit two times. Then if I repeat the process again it will be submitted three times and so on.
In short, the form is submitted as many times as I access this page, even if I just access the it and go back using the back button, without submitting the form.
This happens also with every page on my app, which I access using a similar router.
Thank your very much! it seems that the problem is solved. However, could you please explain the reason why it wasn’t working before and with this fix it does?
Because with using app.on every time you just add more and more same event listeners (and you don’t remove them later) so with every page load form will be submitted more and more times.
And with correct code it just add event handler for that specific form.