View Full Version : getting document.forms.submit() to refresh to different position on page

08-08-2005, 10:26 PM
I have code that I am working with that has a bunch of select statements that use onchange. I use onchange with the actual select statement and call a function that then calls document.forms['beltSelect'].submit();

Also at the bottom of the page are a bunch of javascript if statements such as if ('<% response.write session("specificBelt") %>' != ''){ document.forms['beltSelect'].txtBeltSelector.value = '<% response.write session("specificBelt") %>';} This keeps the value of the different components on the form.

My question is, is there a way to use what I have already, but when the select statement changes, have the page refresh to that same spot? Every time it submits now, it goes back to the top and the user has to scroll all the way down sometimes.

Any help is greatly appreciated... Thanks

08-09-2005, 06:32 AM
Set focus to the combobox onload.

function scrollToSelect(){
<body onload="scrollToSelect();">

08-09-2005, 02:16 PM
Thank you.. This has helped fix my problem.