Solved

I would like to add a field for adding adding sub-categories within my coldfusion query output

Posted on 2012-03-13
2
179 Views
Last Modified: 2012-04-14
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
0
Comment
Question by:brihol44
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 39

Expert Comment

by:gdemaria
ID: 37720115
Sure, you can add a CFIF statement with a flag each time the category changes like this..

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>
0
 
LVL 52

Accepted Solution

by:
_agx_ earned 350 total points
ID: 37722587
Wouldn't placing it before the inner cfoutput do the same thing?

<cfoutput query="test" group="record_ID">
  Main Category  1
  1 input field and submit button to add more sub-categories then list all sub-categories
   <cfoutput>
   Sub Category 1
    ....
   </cfoutput>
</cfoutput>
0

Featured Post

What is a Denial of Service (DoS)?

A DoS is a malicious attempt to prevent the normal operation of a computer system. You may frequently see the terms 'DDoS' (Distributed Denial of Service) and 'DoS' used interchangeably, but there are some subtle differences.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hi, I will be creating today a basic tutorial on how we can create a Mail Custom Function and use it where ever we want. The main advantage about creating a custom function is that we can accommodate a range of arguments to pass to the Function and …
Hi. There are several upload tutorials using jquery and coldfusion. I found a very interesting one here Upload Your Files using Jquery & ColdFusion and Preview them (http://www.randhawaworld.com/) . I did keep the main js functions but made sever…
In this brief tutorial Pawel from AdRem Software explains how you can quickly find out which services are running on your network, or what are the IP addresses of servers responsible for each service. Software used is freeware NetCrunch Tools (https…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question