This week's book giveaway is in the OCAJP 8 forum. We're giving away four copies of OCA Java SE 8 Programmer I Study Guide and have Edward Finegan & Robert Liguori on-line! See this thread for details.
The back button and history.back() have been the bane of most web app developers since, like... FOREVER. There is no easy fix that i have found, (and believe me i have looked.) But here are some ideas... First of all, what triggers the validation method? It sounds like the body onload event handler. If this is the case you might try to use a different handler. If you can't change the the handler you might want to try to have the button regenerate the page supplying the valid data or disabling the validation routine altogether. This is a little combersome ,but it should work.
Joined: Apr 18, 2002
You mentioned that I could disable the validation altogether. Do you know how I could do this. Is there some function I could use? Any help is appreciated. Thank you, Anthea
Hi Anthea, Are you creating something like an index of pages or something? If so, your best bet (least what I get from your message) is to set a hidden field on your page, once into it. Upon clicking the button set it to something else. Heres the small trick. When you do click the button check first on the state of the value in the hidden field. If it is, say, 1 coming in and it turns to 2 when you click the button to leave the page, it should be 2 when you go back to it as well. This way you know you have been there before. I hope this is something on the lines you were looking for. Rob
Here is a useful link. http://developer.netscape.com/docs/manuals/communicator/jsref/wina2.htm One solution to your problem, is try to get the "history.current" location. Check the history.length. Also check to see if there are more history items that occur after the history.current. If they do, then you are sure that the user has hit the back button. i have not done this myself, but just and idea. Please do let us know if you have found out anything that works. One more idea could be using cookies.
Joined: Apr 18, 2002
Hi, Thank you very much for all your responses.