Important alert: (current site time 7/15/2013 11:45:42 PM EDT)
 

winzip icon

ASP Tab Dialog Control

Email
Submitted on: 9/4/2002 9:36:58 AM
By: Tom Bruinsma 
Level: Beginner
User Rating: By 33 Users
Compatibility: ASP (Active Server Pages), HTML
Views: 44801
author picture
(About the author)
 
     UPDATED 11/4/3002 -- This code is used to create a tab control similar to the tabbed dialog control in vb, it comes in very handy when you have alot of information to display but no room to put it. You simply add the tabbed dilaog and organize everything into sections. With a couple lines of code you can add a tabbed dialog control to anything you wish. The tab control can create static tabs(HTML) or DHTML!!! This has been written in vbscript for the server and javascript for functionality at the client. In addition, when navigating the mouse over the tabs the mouse over will change the backgound image to a selection. The style used was from Windows XP. 11/4/2003 - Updated all the graphics from jpg to gif with transparency. Added a selected tab option to the dynamic tabs. It will now be driven off the tab that is passed in the function call. Added the photoshop files for the graphics so you can change the colors and style to suit your site. I included a few samples of other colors. Last i cleaned up the jump page for the sample, it looked plain. :) Even though the contest is over, I would appreciate your taking the time to vote! Thanks Tom

 
winzip iconDownload code

Note: Due to the size or complexity of this submission, the author has submitted it as a .zip file to shorten your download time. Afterdownloading it, you will need a program like Winzip to decompress it.Virus note:All files are scanned once-a-day by Planet Source Code for viruses, but new viruses come out every day, so no prevention program can catch 100% of them. For your own safety, please:
  1. Re-scan downloaded files using your personal virus checker before using it.
  2. NEVER, EVER run compiled files (.exe's, .ocx's, .dll's etc.)--only run source code.

If you don't have a virus scanner, you can get one at many places on the net including:McAfee.com

 
Terms of Agreement:   
By using this code, you agree to the following terms...   
  1. You may use this code in your own programs (and may compile it into a program and distribute it in compiled format for languages that allow it) freely and with no charge.
  2. You MAY NOT redistribute this code (for example to a web site) without written permission from the original author. Failure to do so is a violation of copyright laws.   
  3. You may link to this code from another website, but ONLY if it is not wrapped in a frame. 
  4. You will abide by any additional copyright restrictions which the author may have placed in the code or code's description.


Other 6 submission(s) by this author

 


Report Bad Submission
Use this form to tell us if this entry should be deleted (i.e contains no code, is a virus, etc.).
This submission should be removed because:

Your Vote

What do you think of this code (in the Beginner category)?
(The code with your highest vote will win this month's coding contest!)
Excellent  Good  Average  Below Average  Poor (See voting log ...)
 

Other User Comments

9/6/2002 12:17:31 AMDesign7

Just what I was looking for!
Very good design and code.
Excellent, 5 globes
(If this comment was disrespectful, please report it.)

 
9/6/2002 1:02:16 AM

example doesn't include any form fields on the tab pages. when i added mine, and put a submit button below the tab container, when form was submitted, it only posts form fields on the currently selected tab. what about the other form fields on the other tabs, they should be able to be submitted all at the same time?
(If this comment was disrespectful, please report it.)

 
9/6/2002 9:28:22 AMTom Bruinsma

You can call the save_fields() function, it will update all the form fields then you submit.
(If this comment was disrespectful, please report it.)

 
9/6/2002 2:36:56 PM

/sample/main/calendar_sample.asp this page seams to be missing in the zip.
This is a great idea for developing reports from a database. let's talk.
(If this comment was disrespectful, please report it.)

 
9/6/2002 2:43:19 PMTom Bruinsma

Sorry about that, i will update the zip file
(If this comment was disrespectful, please report it.)

 
9/6/2002 3:14:41 PMTom Bruinsma

I have updated the zip to correct the problem thanks for the input! :)

Tom
(If this comment was disrespectful, please report it.)

 
9/19/2002 12:34:13 AM

Good. But this script can not acces with Netscape 4.0
Can you update for Netscape too?
Thank's.
(If this comment was disrespectful, please report it.)

 
9/20/2002 10:48:03 AM

Forgive my ignorance but where is the save_fields() function you mentioned above? I am having problems saving data from different pages.
(If this comment was disrespectful, please report it.)

 
9/20/2002 1:22:05 PMTom Bruinsma

function change(sWhere) { /*This function should be called anytime you want to change forms, this will save all changes and jump to the next form */ frmMain.action =
(If this comment was disrespectful, please report it.)

 
9/20/2002 1:23:00 PMTom Bruinsma

frmMain.action = "project.asp?Tab=" +sWhere +"&SR=<%=Request("SR")%>"; frmMain.submit(); }
(If this comment was disrespectful, please report it.)

 
9/20/2002 1:30:14 PMTom Bruinsma

Let me know what you guys think. Should i add a sample with form posting? Let me know.
(If this comment was disrespectful, please report it.)

 
9/21/2002 7:12:47 PM

amazing code...I can this this coming in handy somewhere down the road...

5 globes - well done Tom
(If this comment was disrespectful, please report it.)

 
10/23/2002 8:45:36 AM

I would love to see this code with form fields....Great Code. Thanks
(If this comment was disrespectful, please report it.)

 
10/30/2002 1:53:25 PM

How can i retrieve and save the form fields?
(If this comment was disrespectful, please report it.)

 
11/12/2002 3:17:27 AM

When I download the zip file the README file is empty. The help folder is also empty. Is this correct?
I am trying to display data from an Access database, but cannot get my old code to work with the script.
(If this comment was disrespectful, please report it.)

 
11/12/2002 9:57:32 AMTom Bruinsma

This is correct, I set it up in a sample production structure. Instead of putting all the files in one directory I tried to show my sample in more of a real world application.
(If this comment was disrespectful, please report it.)

 
11/12/2002 9:58:18 AMTom Bruinsma

The only thing you should need to do to get the sample working is open the system/system.asp file and set your base path

(If this comment was disrespectful, please report it.)

 
11/18/2002 10:34:01 AM

Any luck on getting this code to work in Netscape? Please respond.
Thank's.

(If this comment was disrespectful, please report it.)

 
11/18/2002 10:36:43 AMTom Bruinsma

Never tested it in netscape, I will do that this week and let you know. It is not dificult just requires a couple of hours to tweak it to be netscape friendly. I also need to find some time to do the forms sample everyone has been waiting for.
(If this comment was disrespectful, please report it.)

 
12/29/2002 8:33:14 PM

Hi,
I like what you did here, but the save_fields func mentioned above is not present anywhere in your code.Is it the same as function Change(sWhere) which you mentioned above?

(If this comment was disrespectful, please report it.)

 
1/16/2003 1:12:05 PM

Excellent code.....when I change the name of the tab to a name with more than or less then 5 characters, the menu.on.bg background does not show. How can I fix this?

Thanks
(If this comment was disrespectful, please report it.)

 
1/16/2003 1:29:17 PMTom Bruinsma

Can you send me a sample of what you are talking about. I have not experianced that problem and I have been unsuccessful at duplicating it. :(
(If this comment was disrespectful, please report it.)

 
1/16/2003 2:10:13 PMTom Bruinsma

Remember, when using the tabs you need to change the Querystring to reflect the correct tab. :) MyTabControl.AddTab "The Tab Name","location='staticTab.asp?Tab=The%20Tab%20Name'". If anyone has any problems you are welcome to email me and I will assist in any way i can.
(If this comment was disrespectful, please report it.)

 
1/16/2003 2:11:55 PMTom Bruinsma

Oh, and as always. Thanks go out to those users who have sent me samples and examples of what they have done while using this code. It is very enjoyable to see that something you write is useful to others.

Thanks!
Tom
(If this comment was disrespectful, please report it.)

 
2/25/2003 12:04:40 AMnfs

Yeah, that is a a nice work.

Do you want to make money with your programming skills ? Software Objects provide following services :
1)Sell your software.
2)Post
a software to be done.
3)Bid on the software projects.
4)Buy software
Thanks and have a nice day.
Software Objects
http://www.thesoftwareobjects.com


(If this comment was disrespectful, please report it.)

 
2/27/2003 4:48:48 PMCookieOSU

This is really great code. I am experiencing a minor problem. I have this control actually within a form. Some of the fields of the form on on the control, others are on the page itself. When I submit the form, the value of the fields that are within the control gets submited twice. I have a running example if you need to see it. Any help would be greatly appreciated. Thanks!!
(If this comment was disrespectful, please report it.)

 
4/10/2003 6:44:47 AM

Interesting
(If this comment was disrespectful, please report it.)

 
7/1/2003 7:26:19 AM

You can submit the all of the form fields at once by placing the FORM tag before you add any tabs and place the /FORM tag after the tabs. This seems to work for me. I am having the problem that when I switch tabs back and forth then hit submit, the value in the field "XYZ" is posted in the request object as "XYZ, XYZ".
(If this comment was disrespectful, please report it.)

 
7/1/2003 8:21:45 AMTom Bruinsma

That is the problem we have been facing with the dynamic version of the tabs. It is due to the form fields being redrawn into the tab from their current location. when you hit submit it is actually sending two versions of the control. the way i have gotten around this is to change my on submit code. firt i place all the tabs in a form (dont draw the tab control in the form) then on submit i treat it like a tab click to update the fields in the form. Then i submit(). Personally it was such a pain and drawing all the data was so consuming that i now use the static tabs for everything. The next version which i will post soon is static only
(If this comment was disrespectful, please report it.)

 
7/6/2003 3:47:21 PM

I can't get it to work - get only broken images every time - any suggestions?
Thanks
(If this comment was disrespectful, please report it.)

 
7/7/2003 10:00:33 AMTom Bruinsma

In the system folder set you path in system.asp. It needs to know the absolute path to the images. like '/mysite/images'
(If this comment was disrespectful, please report it.)

 
10/18/2003 11:37:55 AM

Awesome code. The best tab I have found! One minor problem - In IE6 (bug in IE, not your code) if newer version set to
(If this comment was disrespectful, please report it.)

 
10/18/2003 11:43:37 AM

In IE6: Tools>Internet Options>Settings --> "Every time visit" causes tabs to flicker and crash IE. Fixes? Thanks!
(If this comment was disrespectful, please report it.)

 
10/27/2003 2:12:49 AM

perhaps a "cut-n-paste" version of this code will be made available so I can try it out. I can't download on these computers but a cut-n-paste option enables putting it up on a server.
(If this comment was disrespectful, please report it.)

 
11/4/2003 1:22:21 PM

How do I make a tab other than the first one be the selected tab when the page loads? I see the sSelectedTab = Request(
(If this comment was disrespectful, please report it.)

 
11/4/2003 1:35:19 PMTom Bruinsma

There is a if statement that sets it. It should be the line following the one you copied in.

If sSelectedTab = "" Then sSelectedTab = ""

I have attached the new version of the control, most of the improvements are graphical. In addition the photoshop templates are included for the graphics so it is easier to change the color scheme that is used.

Let me know if you have any questions, also, please don’t forget to vote. :)

Thanks
Tom
(If this comment was disrespectful, please report it.)

 
11/4/2003 1:37:37 PMTom Bruinsma

If anyone else wants the new graphics routines let me know, I havent made a nice sample out of it yet. When i have time to complete the sample around the code i will update the zip here.
(If this comment was disrespectful, please report it.)

 
11/4/2003 2:02:57 PM

I see where that is in the static tabs, and I can get it to work there now. But im still not able to get it to work in the Dynamic Tabs and thats the one I want to use. Thanks.
(If this comment was disrespectful, please report it.)

 
11/4/2003 3:59:59 PMTom Bruinsma

I have uploaded the updated version to PSC, please see the comments above for all that was added :)
(If this comment was disrespectful, please report it.)

 
11/16/2003 1:44:08 PM

Nicest example of an ASP Tab control I have seen. Great versatility in both the static and dynamic tab controls. Have had issues with the dynamic tabs not clearing the page when first loaded resulting in the table structures of all tabs showing at once. Have also had experiences with IE 6.0 crashing but looking at this from an IE perspective.
Thanks for code and nicely written :-)
(If this comment was disrespectful, please report it.)

 
1/14/2004 3:22:50 AM

Im currently using dynamic tab, can you provide samples on how to get all form values from all tabs when i click submit. thanks
you can email me at miceislands@yahoo.com
(If this comment was disrespectful, please report it.)

 
2/9/2004 2:04:07 PM

I try to find a way to save all the fields both three tabpages How can i manage this?
(If this comment was disrespectful, please report it.)

 
3/26/2004 5:08:01 AM

Ran app in IE6(static tab).Gives error 'Line 116 object expected ../dynamictab.asp'.Tried to debug .Seems JScript error in function call onmouseover='TabOver(this)' onmouseout='TabOver(this).'this' is not able to pass object to the called JScript function.

Also,the downloaded zip file ..\sample\README_TODO.txt has no contents(0KB file).

(If this comment was disrespectful, please report it.)

 
3/26/2004 5:13:15 AM

I am trying to integrate the Tab control app into my web application.Trying to use the static tab.
Correction Error is 'Line 116 object expected
../StaticTab.asp'.On drilling down further,the problem seems to be in tabControl.asp where the event function calls onmouseover='TabOver(this)'
onmouseout='TabOver(this) in DrawStatic() subroutine is failing as the parameter 'this' passed to the JScript function is not being recognized as an object.

Appreciate a quick response as I have a deadline to meet.

Dynamic tab also doesn't work.
(If this comment was disrespectful, please report it.)

 
3/26/2004 6:06:51 AM

Finally got it to work.Path was not set up correctly.Chaged path from ..\ASP_Tab_Dialog\system to ..\system.

;-)
(If this comment was disrespectful, please report it.)

 
4/1/2004 6:02:38 PMjrobin9445

Awesome code! Had a quick question. I am trying to do a tabs page within one of the tabs pages, and it is giving me an error having to do with the "option explicit". Have you tried to do this before?
(If this comment was disrespectful, please report it.)

 
6/18/2004 3:18:13 AMHunter Beanland

Excellent control. I have add Inline Frame support, made it Mozilla compatible and re-written much of the code to make it more modular. See: http://www.planet-source-code.com/vb/scripts/ShowCode.asp?txtCodeId=8891&lngWId=4
(If this comment was disrespectful, please report it.)

 
7/13/2004 4:03:28 PMBrian Beverage

Is there a way to create mutiple row tabs?
Example if there are 10 tabs, can the tabs be split into two rows of 5?
(If this comment was disrespectful, please report it.)

 
11/19/2004 5:28:45 AMMattD-J

Anyone had any problems with form validation? none of my form functions work after putting the form on a tab.

(If this comment was disrespectful, please report it.)

 
1/14/2005 10:02:53 AM

What can go in the tab containers? I tried referencing an asp script that queries a db but received an error asp pages need to start with an @. My first line is <%@language=VBScript%> and then I have a bunch of code before the html starts. Is this legal?
(If this comment was disrespectful, please report it.)

 
1/14/2005 10:07:24 AMTom Bruinsma

Anything can go in, however, you need to realize that it is a part of the page. That means that any page you are including in a tab should not have any formating for the page. You can omit the <@langu.. None of these should be included on the tab pages because they are loaded inline as part of the primary page. Let me know if this helps. Tom
(If this comment was disrespectful, please report it.)

 
2/24/2005 3:43:25 PM

I have a situation.

I have 3 tabs and I have form controls on each tab. I want user to fill out all forms and submit all the values (from 3 tabs) on click of a button on the final tab.

I only get values from the last form where the submit button is.

I have " < form>< /formm> " (ignore the space) tags on the StaticTab.asp page and none of the tab pages have < form> tag.

I saw your comments above, but do not see an exact solution to this problem.

Secondly, when I change the value on Tab 1 form --> go to Tab 2 form and come back, I loose my changed value on Tab 1 form.

Any help on above issues greatly appreciated.

Thanks

(If this comment was disrespectful, please report it.)

 
4/25/2005 3:22:40 PMKevin Story

Is there a way to create mutiple row
tabs?
(If this comment was disrespectful, please report it.)

 
4/25/2005 4:30:00 PMTom Bruinsma

That is a really good question. With the current version of the control it is not possible out of the box. I would suggest changing the tab generation to include a TR, then change the js to include a property to determine row.
(If this comment was disrespectful, please report it.)

 
4/25/2005 4:31:24 PMTom Bruinsma

I have a new update that I will be releaseing soon, it will include the ability to have pictures in the tabs, tabs with different heights. A cleaner interface to the tabs. I will see about adding multiple rows to that release as well.
(If this comment was disrespectful, please report it.)

 
7/26/2005 11:38:28 PMdamaso

hi..can you email me your updates on your work.. this is really cool!!!
(If this comment was disrespectful, please report it.)

 
6/27/2006 10:55:12 AMTom Bruinsma

For those people interested in the latest version. Please feel free to send a message. I have had numerous improvments over the years including mozilla compatability. I havent had time to dupate the docuemntation and as a result I havent released the new version. I hope to finsh that in the near future and get an update out. :)
(If this comment was disrespectful, please report it.)

 

Add Your Feedback
Your feedback will be posted below and an email sent to the author. Please remember that the author was kind enough to share this with you, so any criticisms must be stated politely, or they will be deleted. (For feedback not related to this particular code, please click here instead.)
 

To post feedback, first please login.