wood burning stoves 2.0*
The moose likes HTML, CSS and JavaScript and the fly likes when broswer back button pressed form data is changed. Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Engineering » HTML, CSS and JavaScript
Bookmark "when broswer back button pressed form data is changed." Watch "when broswer back button pressed form data is changed." New topic
Author

when broswer back button pressed form data is changed.

neena gupta
Greenhorn

Joined: Sep 17, 2006
Posts: 5
I have JSP page which contain 2 select box.
When i choose one value from one select box i am displaying some values in other select box from javascript.

After submitting form when user press back button then i am not able to see same value that i entered while submitting.

Please help me for this. Is there any way to findout that browser back button pressed or which event it calls. I am using strut framework also.
Mike Firkser
Ranch Hand

Joined: Oct 21, 2003
Posts: 247

When the user presses the back button, the information on the current page is not process--all that happens is the browser displays the previous page. You should tell your users never to use the back button.


Mike Firkser
Rutgers '84
neena gupta
Greenhorn

Joined: Sep 17, 2006
Posts: 5
But suppose if he is using browser back button then what is the way to know that back butoon is pressed or which event it calls in javascript.
Eric Pascarello
author
Rancher

Joined: Nov 08, 2001
Posts: 15376
    
    6
Why does it matter the browser's state has changed to the last setting? When it is submitted again, it will tell you the new state.

Eric
neena gupta
Greenhorn

Joined: Sep 17, 2006
Posts: 5
Try to understand my problem please

I have one search page which has many conditions for finding the data.
That conditions i am specifying in 2 combobox.
If user perform submit. Then on next page he see the data. Now if he want to see search condition that he choosed from combo and he presses back button.

Then i want to see the same form values(Values in combo which is changing populated using javascript) which was before submitting.

Please tell me if there is way to findout that browser back button is pressed.
Rajan Chinna
Ranch Hand

Joined: Jul 01, 2004
Posts: 320
Are you changing the combobox state after submit?
neena gupta
Greenhorn

Joined: Sep 17, 2006
Posts: 5
I am not changing state of combo after submitting.
When i press browser back button then its value is changing(It is giving values which display on form onload not that i choosed before submitting.
Mike Firkser
Ranch Hand

Joined: Oct 21, 2003
Posts: 247

This is what your problem sounds like:

User comes to Search Page, and types search value "Java" into a text box, and clicks the search button. Page 2 appears with search results. If the user clicks the back button, which will return them to the Search Page, you want "Java" still appearing in the text box. Is that correct?

If that is correct, I'm not sure there is a way to have that text box filled in.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: when broswer back button pressed form data is changed.