HTML, JavaScript And CSS Help
 
Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
 
 
User Name:
Password:
Remember me
Go Back   ASP Free ForumsProgrammingHTML, JavaScript And CSS Help

Reply
Add This Thread To:
  Del.icio.us   Digg   Google   Spurl   Blink   Furl   Simpy   Y! MyWeb 
Thread Tools Search this Thread Rate Thread Display Modes
 
Unread ASP Free Forums Sponsor:
  #1  
Old November 6th, 2004, 10:36 AM
lulu lulu is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 54 lulu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 59 m 49 sec
Reputation Power: 4
Question Javascript (tabs)

Hi,

I need some help.

I have a tab menu with a hyperlink on the second tab.

the problem that I am having is when I click on the second tab and then click on a link to reload the same page
it will reload the page and then take me to the first tab instead of the second tab.

so, if I am working on the second tap and click on a link to reload the same page.
it would reload the same page fine but I want it to go to the second tab not the first tab.

<a href="mail.asp?id=<%=objRS2("id")& "#onClick=showtab('MailTab')"%>">
the code above reload the same page mail.asp retrieve an id code then I want it to go to the second tab.
(it go to showtab('MailTab') for one second then it will take me to the first tab but I want it to stay on the second tab.)

the id for the second tab is:
<div id="MailTab">

that's what I have above each tab. (either hide or show)
<td width="10%" onClick="showtab('MailTab');hidetab('singleTab');hidetab('E ditTab');hidetab('ViewTab');hidetab('PhTab');hidet ab('BlockTab');" onMouseUp="style.cursor='hand';" valign="middle" height="12" bgcolor="#FFFFFF">

Thanks,
lulu

Reply With Quote
  #2  
Old November 6th, 2004, 10:54 PM
shamrog12's Avatar
shamrog12 shamrog12 is offline
Newton's Apple Wizard
ASP Free Intermediate (1500 - 1999 posts)
 
Join Date: Nov 2003
Location: Los Angeles
Posts: 1,661 shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level)shamrog12 User rank is Sergeant Major (2000 - 5000 Reputation Level) 
Time spent in forums: 3 Weeks 2 Days 2 h 39 m 22 sec
Reputation Power: 34
Send a message via AIM to shamrog12
to actually go to this URL attached to the second tab I can think of 2 things:

1. when you go to the second tab you have to load this second page like you would with any hyperlink.

2. (the better idea), when a user clicks a tab, set a cookie value to reflect the number of the tab (default should be tab 1). When someone reloads the page you'll have to have a script run in the <head> that determines whether or not the cookie exists and if it does, perform whatever code is necessary to have the second tab active instead of the first. It'll be relatively simple Javascript to accomplish this.
__________________
If you found a post of mine helpful, please click on the on my post to add to my reputation.


Reply With Quote
  #3  
Old November 7th, 2004, 07:54 AM
lulu lulu is offline
Contributing User
ASP Free Newbie (0 - 499 posts)
 
Join Date: Sep 2004
Posts: 54 lulu User rank is Just a Lowly Private (1 - 20 Reputation Level) 
Time spent in forums: 5 h 59 m 49 sec
Reputation Power: 4
Question tabs

hi shamrog12,


Thank you for your reply.

<a href="(How can I create a cookie and set the cookie to = to <%= objRS2("id")%>)


<a href="javascript:document.cookie = 'memid=<%= objRS2("id")%>'">

I have tryied the code above it creates the cookie but it takes me to a blank page with an id number in it.

How can I let it create a cookie and stay at the same page?

Thanks,
lulu

Reply With Quote
Reply

Viewing: ASP Free ForumsProgrammingHTML, JavaScript And CSS Help > Javascript (tabs)


Thread Tools  Search this Thread 
Search this Thread:

Advanced Search
Display Modes  Rate This Thread 
Rate This Thread:


Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
View Your Warnings | New Posts | Latest News | Latest Threads | Shoutbox
Forum Jump


Forums: » Register « |  User CP |  Games |  Calendar |  Members |  FAQs |  Sitemap |  Support | 
  
 





© 2003-2008 by Developer Shed. All rights reserved. DS Cluster 2 hosted by Hostway