Need JS help with Gravity Forms

In this page (site address is hidden – check chat transcript please) there is a Gravity form in here – . The issue is, when a visitor goes through a validation error, the page loads up and scrolls back to the top of the page. The chat representative helped me with the following JS code

(function($) {

$(document).ready(function() {

if($(‘.page-id-4545 .validation_error’:wink:.length) {

if($(‘#toogle-woico .toggle’:wink:.length) {

$(‘#toogle-woico .toggle’:wink:.addClass(‘toggle-active’:wink:;


$(‘html, body’:wink:.animate({

scrollTop: $(“#toogle-woico”:wink:.offset().top

}, 1000);





It did work for one second, but after that, the page scrolls back to the top again. Please help.