Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

going back after sorting report

Status
Not open for further replies.

peterswan

Programmer
Sep 25, 2002
263
US
Hello,

I have a report that is accessed by a form page. The user fills out the form and clicks on submit to view the report. At this point there are several column headers that are clickable which allows the user to sort the report by that column header. The page reloads and fetches new information from the server and redisplays the information in sorted order.

However, at this point, if the user clicks the "Back" button, the same page displays, without the sorts. What I'd like to do is go back to the form page, which is what most users want. They don't need to view the non-sorted report. Some users even think the "Back" button isn't working because the same page displays.

Is there a way in JavaScript, maybe to remove the sorted reports from the "Back" history, thus allowing the user to go back to the form page when the "back" button is clicked, no matter how many times the report is sorted?

Thanks,

Peter [smile]
 
Javascript cannot modify the browser's history. Imagine if it could. A user visits your site and you erase everything in the history, and replace it with a single url: That user clicks the back button and is magically taken to an adult site and gets fired.

Gee, thanks for the script......


You can't change what the windows controls do - back button, refresh button, address bar, etc - these are off limits. What you can do is put a link on your page that can act as the back button. If you'd like users to be able to go back 2 pages you could put a link on your page like this:
Code:
<a href="#" onclick="window.go(-2)">Back</a>

-kaht

Looking for a puppy? [small](Silky Terriers are hypoallergenic dogs that make great indoor pets due to their lack of shedding and small size)[/small]
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top