[thelist] CF Help - I don't know what to call it.

Minh Lee Goon v7ac at sdsumus.sdstate.edu
Tue Jul 18 12:13:53 CDT 2000


Dear evolters,
I'd really like your help with a form I'm working on. Using <cfoutput>,
I'm generating and populating form inputs of type="text" and
type="checkbox". Colleague IDs go into the text boxes and whether or not
each student has accessed a page ("0" and "1") goes into the checkboxes.
It's an administration page so I'd like to give the faculty in charge
the ability to change Colleague IDs and the "Accessed" value. I think I
can work on the Colleague ID part on my own, but I've been stumped when
I try to write the code on the action page of the form to changed the
"Accessed" value. 

Every student has a unique Colleague ID (of course) and the checkboxes
corresponding to each student will be checked if a survey page has been
accessed, and not checked if it hasn't. What I'd like to be able to do
is let the admin faculty member in charge be able to check the box off
to let the student access the page again, if an error had occured
before. I've tried every permutation of <cfif>, <cfoutput>, and
<cfquery> but to no avail. 

The only results I've been getting are that all the checkboxes are
checked or unchecked if I try to change one of them. If I check more
than one, nothing gets updated.

Has anyone tried this with more luck than I? I'd appreciate any help you
can give. Thanks, in advance.

</ml>

<tip type="ColdFusion">
ColdFusion allows you to easily loop through the results of a query
using either the tag <cfloop query="queryname"> or the tag <cfoutput
query="queryname">. However, what you may not know is that it is not
necessary to first test for results of a query before you execute the
loop. 

ColdFusion will automatically check for a record count greater than zero
for the query before it executes the loop. If the query does not contain
any results, the loop is simply ignored. This will save you some
processing time by eliminating the need to wrap your loop with the <cfif
queryname.recordcount gt 0> command.
</tip>




More information about the thelist mailing list