[thelist] JAVASCRIPT: moving the scroll position of the browser onload

Chris W. Parker cparker at swatgear.com
Wed Jun 26 17:17:01 CDT 2002


hi.

i have a page that contains a form. when the user submits the form they
are sent to another page which does the processing (i.e. validation,
other stuff...). if something does not validate they are sent back to
the previous page which contains the form along with an error message
indicating what the problem is.

the form is located at the bottom of the page. i find it highly annoying
that even when using a high resolution like 1152x864 i still have to
scroll back down to the form once it reloads.

i was thinking that maybe it would be more convenient for the user to
have the page automagically scrolled to the very bottom so they could
quickly understand why they were sent back to form page. i think that if
they are sent back and do not immediately realize that there was an
error in the form, they will assume everything went well and move on.
which they shouldn't.

i would like to do this onload (only when the user is sent back of
course) so that it seems normal.

i know the browser (ie) already does this in certain situations, but i
guess not this one.

so... if someone could write a small function (not worrying about
detection of browser or OS) i would greatly appreciate. or at least give
me a few commands i should look into.

thanks,
chris.



More information about the thelist mailing list