nohandlesleft254
IS-IT--Management
Hi,
I have been using a simple JS show/hide tab function. I now want to use it on x rows returned from a query. I have tried dynamic function names etc etc but can get it to work...
*Item = Code of item (each row represents an item)
<script language="text/javascript">
function show(layerName)
{
document.getElementById(layerName).style.display = '';
}
function hide(layerName)
{
document.getElementById(layerName).style.display = 'none';
}
function tabs(Item,Show1,Hide1)
{
hide(Item+Hide1+'_data');
show(Item+Show1+'_data');
}
</script>
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td onClick="javascript:tabs('<cfoutput>#LCase(FindItems.Code)#</cfoutput>','tab1','tab2')">Components</td>
<td onClick="javascript:tabs('<cfoutput>#LCase(FindItems.Code)#</cfoutput>','tab2','tab1')">Customise</td>
</tr>
</table>
<div id="<cfoutput>#LCase(FindItems.Code)#</cfoutput>tab1_data" style="display:none">Tab1</div>
<div id="<cfoutput>#LCase(FindItems.Code)#</cfoutput>tab2_data" style="display:none">Tab2</div>
I have been using a simple JS show/hide tab function. I now want to use it on x rows returned from a query. I have tried dynamic function names etc etc but can get it to work...
*Item = Code of item (each row represents an item)
<script language="text/javascript">
function show(layerName)
{
document.getElementById(layerName).style.display = '';
}
function hide(layerName)
{
document.getElementById(layerName).style.display = 'none';
}
function tabs(Item,Show1,Hide1)
{
hide(Item+Hide1+'_data');
show(Item+Show1+'_data');
}
</script>
<table cellpadding=0 cellspacing=0 border=0>
<tr>
<td onClick="javascript:tabs('<cfoutput>#LCase(FindItems.Code)#</cfoutput>','tab1','tab2')">Components</td>
<td onClick="javascript:tabs('<cfoutput>#LCase(FindItems.Code)#</cfoutput>','tab2','tab1')">Customise</td>
</tr>
</table>
<div id="<cfoutput>#LCase(FindItems.Code)#</cfoutput>tab1_data" style="display:none">Tab1</div>
<div id="<cfoutput>#LCase(FindItems.Code)#</cfoutput>tab2_data" style="display:none">Tab2</div>