View Full Version : Modification to Tabset Menu script

07-15-2003, 04:26 PM

I really like this script Menu Tabset (http://javascriptkit.com/script/script2/tabset/index.shtml) but need it to remember what tab it was on for the current session if the page refreshes.

I have a datagrid control I'm using in one of the tabs that gets refreshed. When it does, the "focus" gets moved back to the first tab.

How can I modify this to "remember" what tab it was on?


07-16-2003, 07:19 PM
I can't believe no one has any help for me.

I didn't think this was that difficult but just more than what I know.

I usually get such good help/tips from this forum.

Roy Sinclair
07-16-2003, 10:27 PM
Usually we like to see the page with the problem either as code within the message (but only if it's not very long) or as a web site where we can look at it. A reference to the source of the script being used is helpful but usually it's not enough by itself.

In this case I suspect you'd need to set a cookie each time the tab changes (use a session cookie, you shouldn't need a permanent cookie) and then as part of the page onload function check for the cookie and if present use the value of the cookie to switch to the appropriate tab.

07-17-2003, 12:33 AM
produce a page with all your code on and include the full javascripts, rather than the link to the libaries and i have an idea, it may not work though.

it just depends on the code.

07-17-2003, 03:05 PM
I am unable to post the page b/c it is a new .aspx page and I don't have an external .NET server set up yet. I have set up a test page though.

Test tab page (http://www.lmibelair1.org/test/test.htm)

I suppose an issue similiar to a control being refreshed would be just hitting refresh or navigating away and coming back to the page. I tried modifying the js that draws the tabs to create and evaluate a cookie but must have not had all the pieces in place b/c it didn't work (so I took it out).

Thanks for checking it out.