Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Selecting Tab Dynamically

Status
Not open for further replies.

Joelo

MIS
Sep 27, 2003
61
0
0
Please how can I make the following script to Dynamically select any of below tabs that is available


dim startTab
tabsDef(1,1)="Men"
tabsDef(1,2)=""
tabsDef(2,1)="Women"
tabsDef(2,2)=""
tabsDef(3,1)="Children"
tabsDef(3,2)=""
tabsDef(4,1)="Adults"
tabsDef(4,2)=""

startTab=1 'the startTab value is used by <BODY onload> to determine which tab to display first.



<script language="javascript">
function showTab(tabnum)
{
// hide all tab content sections, then show the selected content section

for (i=1;i<=<%=uBound(tabsDef)%>;i++)
{
tabName='tabContent' + i;
eval(tabName + '.style.display="none"');
tabName='tabLabel' + i;
eval(tabName + '.style.backgroundColor="<%=TabColor_Ghost%>"');
eval(tabName + '.style.fontWeight="normal"');
undName='tabUnderline' + i;
eval(undName + '.style.backgroundColor="white"');
}

tabName='tabContent' + tabnum;
eval(tabName + '.style.display="block"');
tabName='tabLabel' + tabnum;
eval(tabName + '.style.backgroundColor="<%=BackgroundColor%>"');
eval(tabName + '.style.fontWeight="bold"');
undName='tabUnderline' + tabnum;
eval(undName + '.style.backgroundColor="<%=BackgroundColor%>"');
}

</script>





<body bgColor="white" onload="showTab(<%=startTab%>);">
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top