/    Sign up×
Community /Pin to ProfileBookmark

reload page when user clicks back button?

I am developing a website that has 2 drop down menus on the homepage. The first allows the user to choose a state. After choosing a state, a second menu appears with options for that state. Once the user clicks on an option, he goes directly to that page.

Here is my question:

Say the user chooses California from the first menu and Farmers Markets from the second. He is now looking at a list of farmers markets in CA. After finishing with that page, he wants to go back to the homepage. Instead of clicking the Home link provided, he clicks tha Back button. Now we have problems. When the homepage is accessed through the Back button, the following happens in this case:

California will still be choosen in the first menu. But the second menu does not appear. The only way to get the CA options again is to click on a different state and then click on CA again. Do you follow me?

So, I would like to know if there is a way to refresh/reload a page when the user uses the Back button.

If the user clicks the Home links provided on all the lower level pages, all is well.

Any advice would be GREATLY appreciated. Thanks in advance.

to post a comment
JavaScript

2 Comments(s)

Copy linkTweet thisAlerts:
@jdaviaJan 29.2003 — No page was posted so I must make a guess.

What is happening is when you enter in the States menu and click, it takes you to the Options menu which is on another page. The back button only goes back one page at a time.

You can remedy this with either link below, but you will have to tell your visitors to use it instead of the back button.

<A href="

javascript:window.history.go(-2)">Back</A>

Or just make a link to the page with the "State menu"
×

Success!

Help @Jess2366 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.23,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...