Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Error message for CFIF statement - required attribute INSIDETEXT

Status
Not open for further replies.

BreenK

Technical User
Apr 7, 2000
7
US
I assumed this project from someone who has left, and am attempting to modify the program to allow an additional selection filter. Unfortunately, the page has 275 lines of code, and has multiple nested CFIF statements. Being a novice, I am hoping someone has seen this error message before - I can't find it in any of the development books.

When trying to add a selection to pull certain records from a database, I keep getting the following error:

"Attribute set validation error in tag CFIF

The tag has an invalid attribute combination: the following required attributes have not been provided: (INSIDETEXT)."

I have tried various locations on the page, with no success.
 
Can you post some code? Do you have any empty <cfif></cfif> pairs?

bankholdup
 
This is the code for the page as it is now working

<!--- This page will display the listing of all equipment based on the selections made. --->

<cfinclude template=&quot;../Common/INV_header.cfm&quot;>
</td>
</tr>

<!--Main body of module --->
<!--- This converts the date string to date/time format for the table. --->
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
<CFSET DateQueried = #LSParseDateTime(Form.DateQueried)#>
</CFIF>

<CFIF #Form.SerialNumber# EQ &quot;&quot;>

<CFIF #Form.Item_Type# NEQ &quot;ALL&quot;>
<CFIF #Form.OfficeSymbol# IS &quot;&quot;>

<!--- Lookup was done using Directorate Symbol. --->
<CFIF #Form.Item_Type# IS &quot;ADP&quot;>
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (Directorate = '#Session.Directorate#') AND (ADP = 1) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ &quot;&quot;>
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.ComponentCode# NEQ &quot;&quot;>
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.AssetID# EQ &quot;&quot;>
AND AssetID = '#Form.AssetID#'
</cfif>
<CFIF #Form.Price# EQ &quot;1&quot;>
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ &quot;0&quot;>
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ &quot;&quot;>
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>

ORDER BY OfficeSymbol, UserID
</cfquery>
<CFELSEIF #Form.Item_Type# IS &quot;NON-ADP&quot;>
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (Directorate = '#Session.Directorate#') AND (ADP = 0) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ &quot;&quot;>
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ &quot;1&quot;>
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ &quot;0&quot;>
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ &quot;&quot;>
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ &quot;&quot;>
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
</CFIF>
<CFELSEIF #Form.OfficeSymbol# NEQ &quot;&quot;>
<!---Lookup was done using Office Symbol.--->
<CFIF #Form.Item_Type# IS &quot;ADP&quot;>
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (OfficeSymbol = '#Form.OfficeSymbol#') AND (ADP = 1) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ &quot;&quot;>
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ &quot;1&quot;>
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ &quot;0&quot;>
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ &quot;&quot;>
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ &quot;&quot;>
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
<CFELSEIF #Form.Item_Type# IS &quot;NON-ADP&quot;>
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (OfficeSymbol = '#Form.OfficeSymbol#') AND (ADP = 0) AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ &quot;&quot;>
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ &quot;1&quot;>
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ &quot;0&quot;>
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ &quot;&quot;>
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ &quot;&quot;>
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
</CFIF>
</CFIF>
<CFELSE>
<!---If user wants to display ALL equipment--->
<CFIF #Form.OfficeSymbol# NEQ &quot;&quot;>
<!---Lookup was done using Office Symbol.--->
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (OfficeSymbol = '#Form.OfficeSymbol#') AND (MarkforDeletion = 0) AND (Directorate = '#Session.Directorate#')
<CFIF #Form.EquipmentStatus# EQ &quot;&quot;>
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</CFIF>
<CFIF #Form.Price# EQ &quot;1&quot;>
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ &quot;0&quot;>
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ &quot;&quot;>
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ &quot;&quot;>
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
<CFELSE>
<!-- Lookup was done using Directorate Symbol. --->
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (Directorate = '#Session.Directorate#') AND (MarkforDeletion = 0)
<CFIF #Form.EquipmentStatus# EQ &quot;&quot;>
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
<CFELSE>
AND (EquipmentStatus = '#Form.EquipmentStatus#')
</cfif>
<CFIF #Form.Price# EQ &quot;1&quot;>
AND (UnitPrice >= 2500)
<CFELSEIF #Form.Price# EQ &quot;0&quot;>
AND (UnitPrice < 2500)
</CFIF>
<CFIF #Form.ComponentCode# NEQ &quot;&quot;>
AND ComponentCode = '#Form.ComponentCode#'
</cfif>
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
AND (DateUpdated >= #DateQueried#)
</cfif>
<CFIF #Form.Position_Queried# NEQ &quot;&quot;>
AND (UserID LIKE '#Form.Position_Queried#%')
</cfif>
ORDER BY OfficeSymbol, UserID
</cfquery>
</CFIF>
</CFIF>
<CFELSE>
<!--- Lookup was done using Serial Number. --->
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (SerialNumber = '#Form.SerialNumber#') AND (MarkforDeletion = 0)
AND (EquipmentStatus <> 'E') AND (EquipmentStatus <> 'X')
AND (Directorate = '#Session.Directorate#')
ORDER BY OfficeSymbol
</cfquery>
</cfif>
<cfoutput>
<CFIF #List_records.RecordCount# GT 0>
<!--Records found --->
<CFIF #Form.DateQueried# NEQ &quot;&quot;>
<CFSET client.lastqueried = #DateQueried#>
</CFIF>
<table width=80% border=&quot;0&quot; cellspacing=&quot;1&quot; cellpadding=&quot;2&quot; align=&quot;center&quot;>
<tr><h4>Equipment Inventory</h4><h6>Click on Record Number to see details of record.<br> To print, click on File, Print from browser.<BR>Ensure you change your printer settings: orientation to landscape and paper size to legal size.</h6></tr>
<tr bgcolor=&quot;#TitleColor1#&quot;>
<th>Record No.</th>
<th>Asset ID</th>
<th>BarCode</th>
<th>Manuf Make</th>
<th>Manuf Model</th>
<th width= &quot;100&quot;>S/N</th>
<th width=&quot;70&quot;>Nomenclature</th>
<th>Office Symbol</th>
<th>Unit Price</th>
<th>User ID</th>
<th>Equip Status</th>
<th>ADP</th>

</tr>

<cfform action=&quot;&quot; method=&quot;POST&quot; enablecab=&quot;Yes&quot;>

<cfloop query=&quot;List_records&quot;>
<tr bgcolor=&quot;#IIf(CurrentRow Mod 2, DE('ffffff'), DE('c0c0c0'))#&quot;>
<td align=&quot;center&quot;><a href=&quot;Record_Change.cfm?RecordID=#List_records.ID#&quot; onMouseover=&quot;window.status='CNRC Inventory Website';return true&quot; >#List_records.ID#</a></td>
<td align=&quot;center&quot;>#List_records.AssetID#</td>
<td align=&quot;center&quot;>#List_records.BarCode#</td>
<td align=&quot;center&quot;>#List_records.ManufacturerMake#</td>
<td align=&quot;center&quot;>#List_records.ManufacturerModel#</td>
<td align=&quot;center&quot;>#List_records.SerialNumber#</td>
<td align=&quot;center&quot;>#List_records.Nomenclature#</td>
<td align=&quot;center&quot;>#List_records.OfficeSymbol#</td>
<td align=&quot;center&quot;>#DollarFormat(List_records.UnitPrice)#</td>
<td align=&quot;center&quot;>#List_records.UserID#</td>
<td align=&quot;center&quot;>#List_records.EquipmentStatus#</td>
<td align=&quot;center&quot;>#YesNoFormat(List_Records.ADP)#</td>

</tr>
</cfloop>
</cfform>
<tr>
<b>Total Number of Records: #List_records.RecordCount#</b>
</tr>
<CFELSEIF #List_Records.RecordCount# IS 0>
<!---No records found. --->
<script language=&quot;JavaScript&quot;>
<!-- Hide from Java-challenged browsers
history.back();
alert('No records found. Please correct and resubmit.');
-->
</script>
No records found. Please correct and resubmit.
<CFSET RecordID = &quot;&quot;>
CFABORT
</CFIF>

</cfoutput>
</table>
<cfinclude template=&quot;../Common/footer.cfm&quot;>

= = = = = = =

This is the code I'm trying to insert for an additional selection:


<CFIF>
<!--- Lookup was done using Bar Code. --->
<cfquery name=&quot;List_records&quot; datasource=&quot;INV2&quot; dbtype=&quot;ODBC&quot;>
SELECT *
FROM Assets
WHERE (BarCode = '#Form.BarCode#')
</cfquery>
</cfif>


Any assistance you can provide will be greatly appreciated. I've been placing this code in various locations for several days, with no success.
 
you can't use <cfif> without giving it 2 (or more) option to compare.

<CFIF #Form.DateQueried# NEQ &quot;&quot;> this came straight from the previous code you had. It basically says, &quot;if the value of form.datequeried is not equal to &quot;&quot; (nothing) then do whatever.&quot;


You are trying to use <cfif>, which would just say &quot;if&quot;. And doesn't make any sense to the server.

You need to include under what conditions you want to do the lookup.

Also, if it was me, I might look into compunding the <cfif> statements using AND and OR instead of a bunch of singular <cfif>'s or using <cfswitch>

bankholdup
 
THANKS for your guidance. I decided instead of trying to locate the new code within one of the existing CFIF statements, I just created a new CFIF before the OUTPUT command. This resolved the errors.

As for re-writing all the code and compunding the <cfif> statements using AND and OR, I'll wait on that for a rainy day. I figure, &quot;If it works, don't fix it!&quot; However, for future applications that I create, I'll take your suggestion to heart.

Thanks again!
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top