brihol44
asked on
I would like to add a field for adding adding sub-categories within my coldfusion query output
I have my cfoutput working just fine like so....
<cfoutput query="test" group="record_ID">
Main Category
<cfoutput>
Sub Category
<cfoutput>
</cfoutput>
I would like to add a field though for adding sub-categories like so....
<cfoutput query="test" group="record_ID">
Main Category 1
<cfoutput>
1 input field and submit button to add more sub-categories then list all sub-categories
Sub Category 1
Sub Category 2
Sub Category 3
<cfoutput>
</cfoutput>
I'm wondering if using a cfloop is the way to go but I'm hoping to have the 1 field be at the top or above all sub-categories and below the main categories so the user can enter in more sub-categories.
Thanks,
Brian
<cfoutput query="test" group="record_ID">
Main Category
<cfoutput>
Sub Category
<cfoutput>
</cfoutput>
I would like to add a field though for adding sub-categories like so....
<cfoutput query="test" group="record_ID">
Main Category 1
<cfoutput>
1 input field and submit button to add more sub-categories then list all sub-categories
Sub Category 1
Sub Category 2
Sub Category 3
<cfoutput>
</cfoutput>
I'm wondering if using a cfloop is the way to go but I'm hoping to have the 1 field be at the top or above all sub-categories and below the main categories so the user can enter in more sub-categories.
Thanks,
Brian
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
This will show only one field for every category..
<cfoutput query="test" group="record_ID">
Main Category 1
<cfset newCategory = true>
<cfoutput>
<cfif newCategory>
1 input field and submit button to add more sub-categories then list all sub-categories
<cfset newCategory = false>
</cfif>
Sub Category 1
Sub Category 2
Sub Category 3
<cfoutput>
</cfoutput>