Scroll to top of page after form submission

I'm using a form component within my app.

Just want some simple functionality where it automatically scrolls to the top of the page on form submit (the submit button is pressed and successful). The app functionality is for DB updating in our work place so the user will submit a form, then another etc etc.

Currently I was running this script on press of submit button:

window.scrollTo({ top: 0, behavior: 'smooth' });

But doesn't seem to work, sure there's an easy solution.

Thanks!

Hi @rjb2000,

This is possible through the 'Control Component' event handler.

Add another event handler to your button, pick a component at the top of your page and use the 'Scroll into view' action. Have a look at the screenshot below for an example.

Thanks! Really helpful

Russ