Even though this is an old question I thought I might as well throw in the answer, as I was having the same problem recently. The page jumping is caused by the .NET validation functions and is a known bug/feature. Somewhere in the validation script is a call to window.scrollTo(0, 0) and that is what causes the jumping.
A very quick workaround it to override the scrollTo function with an empty function on $(document).ready() or similar: window.scrollTo = function () { }
Just be sure that there aren't any other scripts using that function, as they will fail as well. I have tried using the following code with great succes:
window.originalScrollTo = window.scrollTo; window.scrollTo = function () { }
Then I can still use the scrollTo functionality, however, the form validation wont make the page jump.
Contour resetting scroll bar to the top of the page when validating input
I have a request from a client to stop a page jumping to the top of the page after a contour form fails validation.
Does anyone know why it does this and how easy it might be to change this behaviour? It looks like the validation is done client-side.
Thanks
Even though this is an old question I thought I might as well throw in the answer, as I was having the same problem recently. The page jumping is caused by the .NET validation functions and is a known bug/feature. Somewhere in the validation script is a call to window.scrollTo(0, 0) and that is what causes the jumping.
A very quick workaround it to override the scrollTo function with an empty function on $(document).ready() or similar: window.scrollTo = function () { }
Just be sure that there aren't any other scripts using that function, as they will fail as well. I have tried using the following code with great succes:
window.originalScrollTo = window.scrollTo;
window.scrollTo = function () { }
Then I can still use the scrollTo functionality, however, the form validation wont make the page jump.
is working on a reply...