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 Mike Lewis on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

reload javascript question

Status
Not open for further replies.

TheCandyman

Technical User
Sep 9, 2002
761
0
0
US
I have a page that has 2 drop down menus (javascript) and the person selects the first which determines whats in the second. when they select both of their choices, they are redirected to a different page.

That works just fine, the problem i am having is in the return to the page. if they use a link to return everything works, but if they click the 'Back Arrow' their old selection is sitting there still. That's the problem.

I have refreshed the page once when it's viewed which doesn't help. The old values are still there.

What's the difference between clicking a link and clicking the back arrow with a refresh?
 
clicking a link sends a request to the server to get the page again. clicking the back button uses the stored by the browser. Refereshing afterwords sends another request for the original document.
 
If you use a link to go back to the page in question, you are probably going back with no strings attached. - literally. Meaning there is no code in your querystring or form. On your page in question, there is probably code that is looking for values that have been set server side and are being used to set your list box selections - re: SELECT attribute.

It is common practice for a coder to set the values of a select box to the previous chosen values.
 
there are no server side variables, it's all javascript, so it's local. And there are no strings in the URL. If it's Javascript and they click 'Back' and then the page is stored locally but i have it refreshing itself on each load, it should pull the server and get a new copy right?

On a side thought, how would i make a SELECT case go to one selection when a page is loaded. I could just move it to the start position and everything would be fine....
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top