Hi,
My asp page displays rows of data. It has a button which has a function to submit itself and add 5 more rows to the page. After adding new rows to the page, I want to redisplay the page but go directly to the area of the new rows, not from the top of the page. I do this by using onload function. The problem is when I use back button.
Let's say first time when I come in this page I see the page with 10 rows. After click a button, I got a page with 15 rows and it display to the area of the new rows. When I click back button, I want it to go back to the page with 10 rows. But instead it goes to the page with 15 rows (and display at the top of the page).
Please help. Below is my code snipplet.
My asp page displays rows of data. It has a button which has a function to submit itself and add 5 more rows to the page. After adding new rows to the page, I want to redisplay the page but go directly to the area of the new rows, not from the top of the page. I do this by using onload function. The problem is when I use back button.
Let's say first time when I come in this page I see the page with 10 rows. After click a button, I got a page with 15 rows and it display to the area of the new rows. When I click back button, I want it to go back to the page with 10 rows. But instead it goes to the page with 15 rows (and display at the top of the page).
Please help. Below is my code snipplet.
Code:
<script type="text/javascript">
onload = function()
{
var target = "#rowpos" + document.f1.XROWCNT.value;
window.location.href = target;
}
</script>
Code:
<%for i = 0 to strrowcnt %>
<tbody>
<tr><td bgcolor="#999999" colspan="41" ><a name="rowpos<%=(i)%>"></a><img src="images/spacer.gif" width="1" height="1" border="0"></td></tr>
</tbody>
<tr>
<td width class="ver10pxblk"><input type="Text" name="XCODE<%=i%>" size="10" maxlength="10" value="<%=code(i)%>" ></td>