Sometimes, after submitting a form, you may want to scroll the page to the top instead of just the success message element. This can help ensure that users see any confirmation messages or follow-up instructions that you have placed at the top of the page. You can achieve this in Convert Forms by adding the following simple JavaScript snippet to your Joomla site.
Javascript Snippet
Place the following Javascript snippet into the Custom Javascript option in the form builder.
ConvertForms.Helper.onReady(() => {
var formID = 1; // Set your form's ID here
var form = document.querySelector('#cf_' + formID);
form.addEventListener('afterTask', () => {
setTimeout(() => {
window.scrollTo(0, 0);
}, 10)
});
})
Remember to set your form's ID in the formID variable.