Jason Hill
07-26-2001, 11:32 PM
Hello,
I have 100 Categories in a database such as Banks, Hotels, Restaurants, etc. Each category has about 10-20 subcategories.
Using ColdFusion, I dynamically list each 100 Categories as an href link. When the user clicks on a category, such as Banks, the value is passed to the same page, and all the subcategories associated with banks, such as Wells Fargo,B of A, and Great Western, are output underneath my 100 main categories.
However, I want each subcategory to be output underneath the appropriat category for a dropdown affect like in Windows Explorer.
How can I use Javascript to dynamically list all subcategories under the apprpiate main category?
Thanks,
Jason
this is my code to output subcategories under the whole list of categories:
<tr>
<td>
<cfoutput query="catquery">
<img src="http://jascomp/dmaps2/Images/#SYMBOL#.gif" height=15 width=15>
<A HREF="d2tree2.cfm?Cat=#CATEGORY#" onmouseover="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/expand.gif'" onmouseout="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/blank.gif'"><b>#CATEGORY#</b></a><br>
</cfoutput>
</td>
</tr>
<tr>
<td>
<CFIF isDefined("url.cat")>
<cfoutput query="comquery">
<img src="http://jascomp/dmaps2/Images/#SYMBOL#.gif" height=10 width=10>
<A HREF="d2tree2.cfm?ID=#ID#" onmouseover="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/mapit.gif'" onmouseout="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/blank.gif'">#COMPANY#</a><br>
</cfoutput>
</CFIF>
</td>
</tr>
I have 100 Categories in a database such as Banks, Hotels, Restaurants, etc. Each category has about 10-20 subcategories.
Using ColdFusion, I dynamically list each 100 Categories as an href link. When the user clicks on a category, such as Banks, the value is passed to the same page, and all the subcategories associated with banks, such as Wells Fargo,B of A, and Great Western, are output underneath my 100 main categories.
However, I want each subcategory to be output underneath the appropriat category for a dropdown affect like in Windows Explorer.
How can I use Javascript to dynamically list all subcategories under the apprpiate main category?
Thanks,
Jason
this is my code to output subcategories under the whole list of categories:
<tr>
<td>
<cfoutput query="catquery">
<img src="http://jascomp/dmaps2/Images/#SYMBOL#.gif" height=15 width=15>
<A HREF="d2tree2.cfm?Cat=#CATEGORY#" onmouseover="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/expand.gif'" onmouseout="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/blank.gif'"><b>#CATEGORY#</b></a><br>
</cfoutput>
</td>
</tr>
<tr>
<td>
<CFIF isDefined("url.cat")>
<cfoutput query="comquery">
<img src="http://jascomp/dmaps2/Images/#SYMBOL#.gif" height=10 width=10>
<A HREF="d2tree2.cfm?ID=#ID#" onmouseover="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/mapit.gif'" onmouseout="window.document.catform.rollimage.src='http://jascomp/dmaps2/Images/blank.gif'">#COMPANY#</a><br>
</cfoutput>
</CFIF>
</td>
</tr>


