Wrox Programmer Forums
| Search | Today's Posts | Mark Forums Read
Javascript How-To Ask your "How do I do this with Javascript?" questions here.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the Javascript How-To section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
 
Old February 10th, 2005, 06:41 PM
Authorized User
 
Join Date: Sep 2004
Location: , , .
Posts: 16
Thanks: 0
Thanked 0 Times in 0 Posts
Default Tab objects in Javascript

How do I create dynamic tab objects in javascript??? I have a page where depending on who logged in would see different tab objects. for eg person 1 could see only ABC , DEF tabs. person 2 could see only ABC tab. So the number of tab object changes as per the person.
 
Old February 11th, 2005, 05:37 AM
Friend of Wrox
 
Join Date: Oct 2004
Location: delhi, delhi, India.
Posts: 553
Thanks: 0
Thanked 1 Time in 1 Post
Send a message via MSN to vinod_yadav1919 Send a message via Yahoo to vinod_yadav1919
Default

Hii TTBhandari !!
You can use ,style object.
Following example can help you
<script>function checkTab()
{
var obj=""
val=document.myform.orgval.value
for(i=1;i<=3;i++)
{
divid="div"+i
if(i!=val){
obj=document.getElementById(divid)
obj.style.display="none";
}

}

}
</script>
<title>xyz</title>
<form name=myform>
<span id="div1" style="display:true"><input type=button name="b1" value=tab1 ></span>
<span id="div2" style="display:true"><input type=button name="b2" value=tab11 ></span>
<span id="div3" style="display:true"><input type=button name="b3" value=tab111></span>
<br>
valid values(1,2,3)
<input type=text name="orgval" >
<input type=button onclick="checkTab()" value="Checkit">
</form>

Cheers :)

vinod




Similar Threads
Thread Thread Starter Forum Replies Last Post
How to disable a tab on a tab control. dbradley VB.NET 6 April 14th, 2011 10:04 AM
Tab in XSLT in 1.0 only pradeepn XSLT 4 May 8th, 2007 06:35 PM
Javascript objects mwells Javascript 1 February 11th, 2007 09:39 PM
Javascript Objects Source Code? mikedshaffer Javascript 3 September 17th, 2003 01:17 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.