I have a DIV in a page that has a vertical scroll. Inside that DIV I have a lot of rows that contain a FORM with a submit button.
<div>
<form>text1 <input type=submit></form><BR />
<form>text2 <input type=submit></form><BR />
<form>text3 <input type=submit></form><BR />
[...]
<form>text99 <input type=submit></form><BR />
</div>
What I want is that after one clicks one of that submit buttons the div should jump to the scroll position it was before. Right now it jumps to position 1 what is very inconvenient. The page is not using JavaScript at all.
Is there a way to do it with CSS or HTML/CSS?
or maybe using session variables(NOT cookies)?
I have been try'n'erroring some hours.
The solution is very simple, you need no jQuery and no Java, just plain HTML
<div>
<form id="link1" action="#link1" >text1 <input type=submit></form><BR />
<form id="link2" action="#link2" >text2 <input type=submit></form><BR />
<form id="link3" action="#link3" >text3 <input type=submit></form><BR />
[...]
<form id="link99" action="#link99" >text99 <input type=submit></form><BR />
</div>
It's going to jump to the id called like the form action link, regardless in what tag the id is. Even this is working:
<div>
<form action="#link1" >text1 <input id="link1" type=submit></form><BR />
<form action="#link2" >text2 <input id="link2" type=submit></form><BR />
<form action="#link3" >text3 <input id="link3" type=submit></form><BR />
[...]
<form action="#link99" >text99 <input id="link99" type=submit></form><BR />
</div>
Have fun guys.