Cannot scroll to top


Posted by Dan_C - Jul 22 ’16 at 11:21

I have my form inside a tab control and next buttons disabling tabs and switching to the next tab.  I have one tab that's longer than the next so when I click next at the bottom the tab switchesfine, but I have to scroll up to see the new active tab.  Trying to avoid this by scrolling to the top with the next button click as well.


Tried all of these and none seem to work:

window.scrollTo(0, 0);

window.scrollBy(0, -100);

$("html, body").animate({ scrollTop: 0 }, 600);

window.location.href = "#top";  //href at the top


No errors in console other than this:

But that is showing on all my forms and doesn't seem to cause any problems.


Any ideas?

  • Dmitry Kozlov
    Dmitry Kozlov
    Member for: 6 years 10 months 25 days
    #1 by Dmitry Kozlov Jul 25 ’16 at 10:39


    Please, try the following code:

  • Dan_C
    Member for: 5 years 8 months 20 days
    #2 by Dan_C Jul 25 ’16 at 12:29

    [#1]: Works.  You're a great help.  Thanks.

Displaying 1 to 2 of 2 messages