Need JS help with Gravity Forms

In this page https://www.mysite.com/consultations-audits/website-audit-services/local-seo-audit/ (site address is hidden – check chat transcript please) there is a Gravity form in here – https://prnt.sc/gk1o4e . 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:;

$(‘.toggle-box’:wink:.show();

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

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

}, 1000);

}

}

})

})(jQuery);

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