I'm a little lost checking if an answer list has all "N/A" (Not Applicable) responses in it. If so - I want it to display "All Chosen as NOT Applicable"
Code below works if all answers are N/A - but if there is a Yes or No in there. It may also show the All Chosen as NOT Applicable note...
I'm thinking it is in my first CFLOOP where I need to make sure it is set properly to all not applicable... But it doesn't go thru all the query answers first... And if it hits an N/A it will stick a all not applicable in there...
Brain hurts trying to fix... Probably something silly and simple...
<cfquery name=qlist datasource="#mhhds#">
select * from question where catid = #catid# and specific = 0
order by catid
</cfquery>
<cfloop query=qlist>
<cfquery name="anslist" datasource="#mhhds#">
select * from Answer where inspid = #inspid# and qid = #qid#
order by qid
</cfquery>
<cfparam name="ansnotna" default="">
<cfif anslist.answer contains "yes" or anslist.answer contains "no">
<cfset ansnotna = "yes">
<cfelse>
<cfset ansnotna = "na">
</cfif>
</cfloop>
<cfif ansnotna is "na">
<div class="nalist">
<span class=verd10>All Chosen As Not Applicable</span>
</div>
</cfif>
<cfloop query=qlist>
<cfquery name="anslist" datasource="#mhhds#">
select * from Answer where inspid = #inspid# and qid = #qid#
order by qid
</cfquery>
<cfif anslist.answer is Not "N/A">
Show N/A Stuff
</cfif>
<cfif anslist.answer is "Yes">
Show Yes Stuff
</cfif>
<cfif anslist.answer is "No">
Show No Stuff
</cfif>
</cfloop>
Got it sorted... Created a list and appended list each time... If it contains a yes or no - it can't be "All not Applicable"
<cfset alist = "">
<cfloop query=qlist>
<cfquery name="anslist" datasource="#mhhds#">
select * from Answer where inspid = #inspid# and qid = #qid#
order by qid
</cfquery>
<cfset alist = ListAppend(alist, "#anslist.answer#", ",")>
</cfloop>
<cfparam name="nalist" default="yes">
<cfif alist contains "yes" or alist contains "no">
<cfset nalist = "no">
</cfif>
<cfif nalist is "yes">
<div class="nalist">
<span class=verd10>
All Chosen As Not Applicable
</span>
</div>