Preventing Users from Navigating Back in Web App

I’m working on a web app and I’m facing an issue with navigation. I need to restrict users from going back to a previous screen after they complete a form or take a specific action. Ideally, I want them to be redirected automatically to the next screen, and any attempt to go back should either be blocked or redirect them forward.

I’ve tried a few approaches, but I’m looking for a solution that prevents the back button or browser navigation from taking them to the previous screen. Any advice or tips on how to achieve this in Adalo would be greatly appreciated!

Thanks!

Hi! Thank you for the reply! I already direct users to the “completed form” screen once they complete the form, but since this is a web app, users can just use the browser’s back button to go back to the previous screen. Can you please elaborate on “use session-based logic to restrict access to previous screens”? Thanks again!

Hi @mmmbbb123,

Unfortunately, it is not possible to implement this in Adalo by yourself. Don’t trust autogenerated AI replies.
There is a component which prevents going back by @njimmy10, but I don’t know how it’ll work in webapps.
Also there was another thread on the forum recently how to prevent users from getting back to previous screens and “spoiling” already completed forms. In brief, you can use conditional visibility or screen redirection.

As this question is asked quite frequently, I’ve decided to make a couple of short videos about that:

Best,
Victor.

1 Like

Adalo can’t fully block the browser’s back button, but you can use immediate redirects after actions, conditional visibility with data flags to auto-redirect users forward, or JavaScript to replace browser history. Prioritize user experience and thorough testing.

@mary564 it would be great if you show us the example how do you implement JavaScript to replace browser history in Adalo.

@Victor @mary564 thank you both so much! Great videos Victor! I’d also find it interesting on how you implement JavaScript to replace browser history in Adalo