Focus on previously selected page

Do you have a question? Post it now! No Registration Necessary.  Now with pictures!

Threaded View

I have a web page in which I have different tab/divs.  So when the
user selects different tabs the the url changes to


What I am trying to do is reset the focus on the currently selected
tab when the form is submitted.  For instance, when the user make a
selection in a form it always return the url to

How can I trap the current url and set it have running the rest of my
code to save/delete/...?

Thank you,


Re: Focus on previously selected page

Quoted text here. Click to load it

By javascript, not with PHP alone (the fragment isn't even sent to the  
server AFAIK). Probably you'll have to set a cookie with javascript on  
changes & load time, and then either act accordingly with PHP's output  
(set a particular div visbile, the rest hidden/display:none), or do that  
with javascript after the pageload.
Rik Wasmus
[SPAM] Now temporarily looking for some smaller PHP/MySQL projects/work to  
fund a self developed bigger project, mail me at rik at [/SPAM]

Re: Focus on previously selected page

Quoted text here. Click to load it

As a general rule I'd avoid using cookies for transferring information
explicitly between one page and the next - rather I only use cookies
for session related data or user related data. My prefered solution
would be to use a hidden form field. However the cookie approach dose
mean that the entire behaviour can be encapsulated with javascript if
POSTs are used.


Site Timeline