# Disabling the scroll down when pressing next, previou or submit buttons

**URL:** <https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923>\
**Category:** Get Help\
**Tags:** conflict, woocommerce, gform\_confirmation\_anchor, ajax, scroll-down\
**Created:** [April 13, 2023, 11:06am UTC](https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923 "2023-04-13T11:06:20Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![webpedromag](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/webpedromag/32/6926_2.png) [@webpedromag](https://community.gravityforms.com/u/webpedromag)\
**Post date:** [April 13, 2023, 11:06am UTC](https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923/1 "2023-04-13T11:06:20Z")

</div>

Dear Community,

I’m using multi-page form with Woocoomerce Gravity Forms Addon, on a Elementor page builder.

I want to prevent the scrolling down of the page when i press any button of the form. This scrolling down happens even if the page is not reloading.

(example: i press the next for the first time and before it goes to the next page of the form it scrolls down the page and after reloads goes again to the first option of the form)

So I’m not using a shortcode to add the form to the page, because I’m using the Woocoomerce Gravity Forms Addon, so the form is embedded in the ‘add to cart widget’.

I’ve tried using the `add_filter( 'gform_confirmation_anchor', '__return_false' );` but it did’nt work for me.

From what I’ve read in other posts it can be because of AJAX and i believe that ajax is enable and working in my page, but don’t know how to do to prevent the scrolling down to happen.

Any help would be very appreciated.

P

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [April 13, 2023, 4:42pm UTC](https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923/2 "2023-04-13T16:42:51Z")

</div>

I think this is related to AJAX being disabled by the Product Add-ons plugin. Try it like this instead:

```auto
add_filter( 'gform_confirmation_anchor', '__return_true' );

```

---

<div class="post-metadata">

**Author:** ![webpedromag](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/webpedromag/32/6926_2.png) [@webpedromag](https://community.gravityforms.com/u/webpedromag)\
**Post date:** [April 13, 2023, 7:45pm UTC](https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923/3 "2023-04-13T19:45:14Z")

</div>

Thanks for the reply Chris.

the filter didn’t worked for me. I just executed it in my functions.php and still the same scrolling down when i press the buttons.

I believe i have AJAX enable because i have a custom button in the same page that sends to the cart a variation with a 0$ to the cart, through a ajax instruction like this one: `$.ajax({ type: "POST", rest of code here}` and i have a success response because the button is working.

Is there a way of making sure if ajax is enable on the page?

Also, Is there an alternative to the WooCommerce Gravity Forms Product Add-Ons?

---

<div class="post-metadata">

**Author:** ![chrishajer](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/chrishajer/32/88_2.png) [@chrishajer](https://community.gravityforms.com/u/chrishajer)\
**Post date:** [April 14, 2023, 2:31am UTC](https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923/4 "2023-04-14T02:31:38Z")

</div>

Hi Pedro. I recommend checking with the plugin author to confirm that AJAX is disabled when using that plugin with Gravity Forms. I had heard that it does, but I’m not certain.

If you need assistance with the scrolling issue on your site, please confirm that the problem occurs when using only Gravity Forms and a default theme from Automattic like Twenty Twenty One. If it does, please [open a support ticket](https://www.gravityforms.com/open-support-ticket/technical/) and include the URL where we can see your form embedded. The conflict test will be the first thing we have you perform if you have not already:

> **[Testing for a Theme/Plugin Conflict](http://docs.gravityforms.com/testing-theme-plugin-conflict/)**
>
> The following sections provide instructions for determining if an issue you are experiencing with Gravity Forms is caused by a theme or plugin conflict.

Thank you.

---

<div class="post-metadata">

**Author:** ![webpedromag](https://sea2.discourse-cdn.com/flex020/user_avatar/community.gravityforms.com/webpedromag/32/6926_2.png) [@webpedromag](https://community.gravityforms.com/u/webpedromag)\
**Post date:** [April 14, 2023, 10:08am UTC](https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923/5 "2023-04-14T10:08:12Z")

</div>

Hi Chris,

So I’ve confirm that the issue is being caused by WooCommerce Gravity Forms Product Add-Ons.  
If i disable the plugin and use a gravity form widget on my page then the scrolling issue disappears (with the filter gform\_confirmation\_anchor in the functions.php).  
Also i can see that ajax is enable because there is no page reloads and i press the next or previous button and no parameter are being added to the url.

But i need that plugin to be able to connect the form with the order creation of woocommerce.  
Any ideas that could help me do this connection without using the WooCommerce Gravity Forms Product Add-Ons?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/flex020/uploads/gravityforms1/original/2X/f/fef63f0599c45e0218c30d9f5d7ca8bff9b00189.png) [@system](https://community.gravityforms.com/u/system)\
**Post date:** [May 14, 2023, 10:08am UTC](https://community.gravityforms.com/t/disabling-the-scroll-down-when-pressing-next-previou-or-submit-buttons/14923/6 "2023-05-14T10:08:44Z")

</div>

Closed on May 14, 2023, 10:08am UTC

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.
