---
title: "Scroll the Page to the Top When a Long Form is Submitted - Convert Forms"
description: "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"
url: "https://www.tassos.gr/docs/convert-forms/functionality/scroll-page-to-top-when-long-form-is-submitted"
date: "2026-04-07T06:49:09+00:00"
language: "en-GB"
---

[ Home ](https://www.tassos.gr/index.php?option=com_content&view=category&layout=blog&id=24&Itemid=1088) / [ Convert Forms ](https://www.tassos.gr/index.php?option=com_content&view=category&id=43) / [ Functionality ](https://www.tassos.gr/index.php?option=com_content&view=category&id=60)

#  Scroll the Page to the Top When a Long Form is Submitted

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](#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.

 Last updated on Nov 26th 2024 12:11

## Schema

```json
{
    "@context": "https://schema.org",
    "@type": "BreadcrumbList",
    "itemListElement": [
        {
            "@type": "ListItem",
            "position": 1,
            "name": "Home",
            "item": "https://www.tassos.gr"
        },
        {
            "@type": "ListItem",
            "position": 2,
            "name": "Home",
            "item": "https://www.tassos.gr/docs"
        },
        {
            "@type": "ListItem",
            "position": 3,
            "name": "Convert Forms",
            "item": "https://www.tassos.gr/docs/convert-forms"
        },
        {
            "@type": "ListItem",
            "position": 4,
            "name": "Functionality",
            "item": "https://www.tassos.gr/docs/convert-forms/functionality"
        },
        {
            "@type": "ListItem",
            "position": 5,
            "name": "Scroll the Page to the Top When a Long Form is Submitted",
            "item": "https://www.tassos.gr/docs/convert-forms/functionality/scroll-page-to-top-when-long-form-is-submitted"
        }
    ]
}
```

```json
{
    "@context": "https://schema.org",
    "@type": "Article",
    "mainEntityOfPage": {
        "@type": "WebPage",
        "@id": "https://www.tassos.gr/docs/convert-forms/functionality/scroll-page-to-top-when-long-form-is-submitted"
    },
    "headline": "Scroll the Page to the Top When a Long Form is Submitted",
    "image": {
        "@type": "ImageObject",
        "url": "https://www.tassos.gr/"
    },
    "publisher": {
        "@type": "Organization",
        "name": "Tassos",
        "logo": {
            "@type": "ImageObject",
            "url": "https://www.tassos.gr/https://www.tassos.gr/media/brand/logo-text.png"
        }
    },
    "author": {
        "@type": "Person",
        "name": "Tassos Marinos",
        "url": "https://www.tassos.gr/docs/convert-forms/functionality/scroll-page-to-top-when-long-form-is-submitted"
    },
    "datePublished": "2024-06-07T10:53:23+03:00",
    "dateCreated": "2024-06-07T10:53:23+03:00",
    "dateModified": "2024-11-26T12:28:42+02:00"
}
```
