### [How to Disable the Scrolling Effect on Field Validation Errors](https://wpforms.com/developers/how-to-disable-the-scrolling-effect-on-field-validation/)

**Published:** April 27, 2021
**Author:** Umair Majeed

**Excerpt:** This tutorial will show you how to disable the scrolling when there are validation errors on the form. 

**Content:**

Would you like to stop WPForms from automatically scrolling to validation errors? By default, when a form has errors – whether it’s a single-page form or one with Page Breaks – WPForms will scroll up to the first error field.

This guide will show you how to disable this smooth scrolling effect, making the page jump directly to the error instead.

## Setting Up Your Form

First, you’ll need to create your form and add your fields. If you need any help in creating a form, our guide on [how to create your first form](https://wpforms.com/docs/creating-first-form/).

## Disabling Scrolling Effects

You have two options for disabling the scroll effect: either for a specific form or for all forms on your site. Let’s look at both methods.

### For a Specific Form

If you want to disable the scroll effect for just one form, use this code snippet. If you’re not sure how to add custom code to your site, please see our [guide on adding code snippets](https://wpforms.com/developers/how-to-add-custom-php-or-javascript-for-wpforms/).

```

/** Disable the scroll on field validation errors
 *
 *  @link   https://wpforms.com/developers/how-to-disable-the-scrolling-effect-on-field-validation/
 */
 
function wpf_dev_disable_scroll_to_error_by_form_id( $forms ) {
     
    // If scrollToError is disabled for at least one form on the page, it will be disabled for all the forms on the page.
 
    foreach ( $forms as $form ) {
 
        // Only run snippet on the form ID 1000
        if ( isset( $form[ 'id' ] ) && (int) $form[ 'id' ] === 1000 ) {
    ?>

**Categories:** Extending

**Tags:** Javascript, PHP

---

