Joelo
MIS
- Sep 27, 2003
- 61
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%>);">
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%>);">