RE: 237 checkboxes

2000-03-30 Thread Daniel Murphy

Thanks for everyone's help. 

Here is how I finally accomplished it. I used a variant of Sean's example:

CFLOOP INDEX="field_name" LIST="#form.fieldnames#"
cfoutput#evaluate('form.'  field_name)#/CFOUTPUT
/CFLOOP

I gave every check box a name (Q1,Q2,Q3...) -I'm only up to 21 right now.

And created this code in the results page (I omitted the table formatting to
make it easier to read):


CFLOOP INDEX="Field" LIST="#Form.FieldNames#"
CFSET Val = Evaluate("Form.#Field#")

cfquery name="#field#" datasource="survey" dbtype="ODBC"
SELECT DISTINCT FIRST_NAME, LAST_NAME, CAMPUS_ADDRESS_1, OFFICE_PHONE,
EMAIL, SCHOOL, QUESTION_NAME, TOPIC_NAME
FROM FACULTY, ANSWER, QUESTION, TOPIC
WHERE
QUESTION$QUESTION_ID = QUESTION_ID
AND
FACULTY$FACULTY_ID = FACULTY_ID
AND
TOPIC$TOPIC_ID = TOPIC_ID
AND
QUESTION_ID = '#Field#' AND ANSWER = '#Val#'
/cfquery

cfoutput query="#field#" maxrows="1"
pFound b#recordcount#/b faculty members who answered quot;yesquot;
to: br
Topic: b#TOPIC_NAME#/b br
Catagory: b#QUESTION_NAME#/b/p
/cfoutput

CFOUTPUT query="#field#"
pName: b#FIRST_NAME# #LAST_NAME#/b/p
pCampus Address: #CAMPUS_ADDRESS_1#/p
pOffice Phone: #OFFICE_PHONE#/p
pE-mail: a href="mailto:#EMAIL#"#EMAIL#/a/p 
pSchool: #SCHOOL#/p
/CFOUTPUT

/CFLOOP

I made a html version of the search form if anyone wants to see it.
http://hs91.ilgard.ohiou.edu/survey/search.html
I am only running the development server that comes with studio so
unfortunately no one but me can see the actual .cfm pages.

Mark and Tobe: Your right -the design is flawed. There are way to many
checkboxes for one page. There are way to many questions in this survey
altogether! This survey was originally sent out in the mail and then mailed
back in and the results were hand entered into excel -if you get my drift; I
was brought in late in the project. I may try to break it up into several
pages instead of one long one.


Thanks again,

Dan
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.



237 checkboxes

2000-03-29 Thread Daniel Murphy

I have search form that contains a large amount of yes/no check boxes -237
to be exact. It is to search the results of a survey that has 237 questions.

Only when a checkbox is checked will data be sent from the form. Because of
this I need to check if each variable is present. I can create 237 "CFIF
IsDefined" statements to see if the variables are present. The other option
is to set 237 CFPARAM variables to "NO" as default, and then create my
dynamic SQL statements with CFIF tags checking for "YES". 

The problems with these two options is that they are slow and will take a
long time to code.

I was thinking:

Is there a way to create a loop that will run through all the values from
the form - creating a query and output for each one.

Thanks, Dan
--
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=listsbody=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.