• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

when broswer back button pressed form data is changed.

 
neena gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 249
Java Oracle PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
neena gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 15385
6
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 320
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Are you changing the combobox state after submit?
 
neena gupta
Greenhorn
Posts: 5
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 249
Java Oracle PHP
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic