Hi everyone. I'm having a bit of a problem with this:
I've made a conditional form to Update or Add a category. I've tried just about everything. I'm using ColdFusion 4.0. This is what I have:
<CFIF IsDefined("CatID"
>
<CFSET NewCat="No">
<CFELSE>
<CFSET NewCat="Yes">
</CFIF>
<CFIF NewCat>
<CFSET PageTitle = "JinMAU - Add a Category">
<CFSET ButtonText = " A d d ">
<CFSET Category = " ">
<CFELSE>
<CFQUERY DATASOURCE="jinmau" NAME="Edit">
SELECT CatID, Category
FROM Categories
WHERE CatID=#CatID#
</CFQUERY>
<CFSET PageTitle = "JinMau - Update a Category">
<CFSET ButtonText = " U p d a t e ">
<CFSET Category = "Trim(Categories.Category)">
</CFIF>
<CFOUTPUT QUERY="Edit">
The error occurs when I try to add a new category. Tells me that the QUERY is not named. So I just put <CFOUTPUT> without the query name. Then I get an "error" when trying to update a category. Well, not a error, but I get the words Trim(Categories.Category) instead of the value of the field. I tried putting the <CFOUTPUT> in the <CFIF NewCat> and <CFOUTPUT QUERY="Edit"> in the <ELSE> with no success.
Thanks in advance,
-NeoTurtle
I've made a conditional form to Update or Add a category. I've tried just about everything. I'm using ColdFusion 4.0. This is what I have:
<CFIF IsDefined("CatID"
<CFSET NewCat="No">
<CFELSE>
<CFSET NewCat="Yes">
</CFIF>
<CFIF NewCat>
<CFSET PageTitle = "JinMAU - Add a Category">
<CFSET ButtonText = " A d d ">
<CFSET Category = " ">
<CFELSE>
<CFQUERY DATASOURCE="jinmau" NAME="Edit">
SELECT CatID, Category
FROM Categories
WHERE CatID=#CatID#
</CFQUERY>
<CFSET PageTitle = "JinMau - Update a Category">
<CFSET ButtonText = " U p d a t e ">
<CFSET Category = "Trim(Categories.Category)">
</CFIF>
<CFOUTPUT QUERY="Edit">
The error occurs when I try to add a new category. Tells me that the QUERY is not named. So I just put <CFOUTPUT> without the query name. Then I get an "error" when trying to update a category. Well, not a error, but I get the words Trim(Categories.Category) instead of the value of the field. I tried putting the <CFOUTPUT> in the <CFIF NewCat> and <CFOUTPUT QUERY="Edit"> in the <ELSE> with no success.
Thanks in advance,
-NeoTurtle