I have an application that creates quotations, orders etc. and as the user adds items the page reloads and can quite long. The problem is then the user has to scroll down to the last item to add another one - this gets to be quite time-consuming. Is there a way I can get it to do this automatically? I have tried putting anchors on each line item like this;
echo "<form action='display_quotation.php?item=$detail_number' method='post'>\n";
.........
echo "<a name='item_$detail_number'></a>\n";
and put the javascript ;
<script type='text/javascript'>
function goToAnchor() {
window.location.hash='#item_$item';
}
</script>
</head>
<body onload='goToAnchor();' >
This doesn't seem to work - I get in the URL http://my_domain/display_quotation.php?item=3#item_3 but the page always goes to tiem no matter what item is passed via post.