Setting Scrollable position for div tag

Giganews Newsgroups
Subject: Setting Scrollable position for div tag
Posted by:  kmreddy_…@yahoo.com (Muralidhar)
Date: 1 Sep 2003

Hi,
  I'm having a jsp page which is having a table and a div tag.The
heading such as a radio button,Name , Age etc. are fixed.Only the data
under it is scrolling. So i've set one table for header which are
fixed.
Then a div tag inside which there is a table which is used for
scrolling the data.When i select a radio i'm submitting the form.The
problem is here i'm able to set focus to the radio button, but i'm
unable to maintain the scrolling position, when i scrolled downeards.I
want the same scrolling position as it was before submitting the form.

Code is something like this

<body topmargin=0 leftmargin=0
onLoad='javascript:fContractScrollTo("<%=hidScroll%>");'>
<html:form action="wspr/loadContract.go">
<table >
<tr>
    <td>radio button</td>
    <td> Name </td>
    <td> Age </td>
</tr>
</table>
<div id="divContractID"
style="height:175;width:460;background:white;overflow:auto;">
  <table>
  <logic:iterate id="Contract" name="CONTRACTLIST">
    <bean:define id="ContractVO" name="Contract" type="ContractVO" />
    <tr>
      <td>radio</td>
      <td>Name</td>
      <td>Age</td>
    </tr>
  </logic:iterate>
</table>
</div>    
</html:form>
</body>

Javascript function like this
function fContractScrollTo('val') {
  window.scrollTo(0,document.getElementById('divContractID').scrollTop);
}

Is it possible to set the maintain the scrollable position in a div
tag.
Thanx in Advance

Replies