/    Sign up×
Community /Pin to ProfileBookmark

How to set page focus after POST

Hi everyone

Im wondering how it might be possible to have a page focus on a specific anchor tag after a post has been run on it. What I have is an ASPX page that has a city search field, and you type in your city and click SEARCH. Once the search has been made, the page refreshes with the new data in the table but the page refreshes to the top of the window. Ive tried some scripts that do on.Load focus but I need it so that first time visitors to that specific page dont get focused on the wrong part of the page on their first visit, ONLY after they press the search button.

Can anyone give me some pointers on how its possible to do this? Much appreciated!!

Thank you very much!
-B ?

to post a comment
JavaScript

1 Comments(s)

Copy linkTweet thisAlerts:
@felgallApr 27.2005 — You need to add #anchorame to the end of the address of the page that is to be loaded so that it knows to position to anchorname (just substitute the name of the anchor you want to position to).
×

Success!

Help @Bassmasterflex 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.18,
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,
)...