RE: 237 checkboxes
Thanks for everyone's help. Here is how I finally accomplished it. I used a variant of Sean's example: #evaluate('form.' & field_name)# 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): 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#' Found #recordcount# faculty members who answered "yes" to: Topic: #TOPIC_NAME# Catagory: #QUESTION_NAME# Name: #FIRST_NAME# #LAST_NAME# Campus Address: #CAMPUS_ADDRESS_1# Office Phone: #OFFICE_PHONE# E-mail: mailto:#EMAIL#">#EMAIL# School: #SCHOOL# 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=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: 237 checkboxes
I wonder who is filling out the 237 question survey, and whether they're getting paid! ;-) Have you considered creating some sort of "profile" to search the survey results by? It'll take just as long to harvest the data as it did to fill it out! And imagine selecting your options all the way down the form, and then returning no results?! ;-) -Original Message- From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]] Sent: Thursday, March 30, 2000 9:41 AM To: [EMAIL PROTECTED] Subject: Re: 237 checkboxes IMHO, it would be a lot simpler to just do them as select boxes w/ a default of no. This way you can just loop through the list w/ one query. Then again 237 is a lot to loop through OR to answer... Tried breaking this up? At 05:21 PM 3/29/00 -0500, you wrote: >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=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. > ATTN. Mario Talavera NetPassage, Inc. 419 N. Magnolia Avenue Orlando, Fl 32801 407.843.7277 888.296.7277 407.839.0126 (fax) http://www.netpass.com [EMAIL PROTECTED] -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: 237 checkboxes
>I think you need to reconsider your form design altogether. > >I think your HTML page (ie the one with the form) is going to lock up or >simply flake out trying to render 237 checkboxes. Not necessarily... I programmed a spreadsheet style form interface once that contained close to 400 form fields, although they were a mix of hidden, text boxes, and selects. It was slow to render, but both NS 4.05 and IE 4.01 were able to do it. However, I do agree that in this case 237 checkboxes may be a bad way to present the data to the user. Regards, Seth Petry-Johnson Argo Enterprise and Associates -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: 237 checkboxes
IMHO, it would be a lot simpler to just do them as select boxes w/ a default of no. This way you can just loop through the list w/ one query. Then again 237 is a lot to loop through OR to answer... Tried breaking this up? At 05:21 PM 3/29/00 -0500, you wrote: >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=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. > ATTN. Mario Talavera NetPassage, Inc. 419 N. Magnolia Avenue Orlando, Fl 32801 407.843.7277 888.296.7277 407.839.0126 (fax) http://www.netpass.com [EMAIL PROTECTED] -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: 237 checkboxes
I think you need to reconsider your form design altogether. I think your HTML page (ie the one with the form) is going to lock up or simply flake out trying to render 237 checkboxes. Tobe At 05:21 PM 3/29/2000 , you wrote: >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=lists&body=lists/cf_talk or >send a message to [EMAIL PROTECTED] with 'unsubscribe' in >the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: 237 checkboxes
You could do this is your checkboxes followed a naming convention For instance if they went from q1 to q237 then you could just loop from 1 to 237 checking if q existed. Mark -Original Message- From: Daniel Murphy [SMTP:[EMAIL PROTECTED]] Sent: Wed, 29 Mar 2000 23:22 To: '[EMAIL PROTECTED]' Subject: 237 checkboxes 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=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: 237 checkboxes
>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. 237 checkboxes! What do your users have to say about that. I have no idea of what your survey consists of but couldn't you possibly categorize the responses and build your search forms based on the new categories. I can't see how you can possibly find any relationships, or draw any conclusions from a variation of 237 check boxes. Also, does that mean a single query will resolve the search, and what are the development implications of this? Sorry, but I went to a User Centered Design presentation last night and have to ask. Mark Zukiwsky Edmonton, Canada -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: 237 checkboxes
On 3/29/00, WBB penned: >Optionally, you can name them all the same, assign them different >values...any that are checked will have their values passed as a list. That >way you only have 1 to worry about. > > > 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. In actuality, unless you explained it wrong, you are saying you have 237 yes/no checkboxes. If you are using checkboxes, you should only have a Yes, and say to click any checkbox that the answer is Yes. Otherwise, you'll invariably have some numbskulls that will check both yes and no and REALLY play havoc with your survery. :) If you need to do Yes/No, use radio buttons and set them all to a default of yes or no. Then you won't have to check for existence because each question will be passed as either yes or no. You could easily loop through and evaluate the "fieldnames" variable: Do your questions with underscores: Do_You_Smoke? The replace the underscores in the QuerySetCell tag. evaluate(myList) will evaluate to yes or no. Then: Here are your survey answers. #Question# - #Answer# THE ONLY THING WRONG WITH THIS IS, FOR SOME REASON COLDFUSION LIKES TO CHANGE FIELDNAMES TO ALL CAPS. Wish they'd fix that. Bud Schneehagen - Tropical Web Creations _/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/_/ ColdFusion Solutions / eCommerce Development [EMAIL PROTECTED] http://www.twcreations.com/ 954.721.3452 -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: 237 checkboxes
You can do the inserts and the updates inside a loop as well. Possibly just append a count variable from 1 to the number of rows in your query at the end of your variable. For example, boxes#count# This would make every variable different for your form and you can then use another loop to access the form variables and insert or update via another loop calling boxes#count#. I messed with this for some time last week and the syntax gets hairy but once you figure it out you can add questions just by inserting them into your database and then the parameters can all be changed via the query telling the tag how many times to loop. So you could have 1 question or 10,000 and it doesn't matter. The loop will take care of it all inserting the answers to the questions. The list idea others have given sounds good as well. Good luck! Michael W. Blair Web Applications Developer Canyon WebWorks An Arizona Internet LLC Company http://www.canyon.net [EMAIL PROTECTED] PHONE: (520) 773-9059 FAX: (520) 773-4945 -Original Message- From: Judah McAuley [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 29, 2000 3:41 PM To: [EMAIL PROTECTED] Subject: Re: 237 checkboxes If you name each of the checkboxes the same (all name="survey_answer" or some such) and give each a different value (name="survey_answer" value="votedinelection" name="survey_answer" value="incomegreaterthan3") then you would get a comma delimited list of all the checked boxes coming through (survey_answer=votedinelect,incomegreaterthan3). You could then loop through this list and do updates. If you gave the checkboxes values identical to database fields and defaulted the values in the DB to 0 or NO, then you could construct the loop fairly simply: *insert blank record* UPDATE dbtable SET #answer# = 'YES' WHERE id = #id_from_previous_query# This will be easier to code than 237 ifs, but on the other hand it could potentially involve 237 updates instead of just one Insert. Efficiency will be determined by percentage of checkboxes likely to be checked. Hope this helps, Judah At 05:21 PM 3/29/00 -0500, you wrote: >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=lists&body=lists/cf_talk or >send a message to [EMAIL PROTECTED] with 'unsubscribe' in >the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: 237 checkboxes
>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. If your questions are all numbered sequentially then this is real easy. Name your checkboxes something like "Question_x" where "x" is the question number. Then... If your questions aren't numbered sequentially then you have to modify this slightly. You will need a list of all the question numbers that are on the form (such as "1,3,4,5,9,11"). Assuming that the list of numbers is in lstNumbers you can do: If you have non-sequential question numbers and need help figuring out how to build the list of numbers let me know. Hope this makes sense, Seth Petry-Johnson Argo Enterprise and Associates -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: 237 checkboxes
H. You could give each checkbox the same name (ex/ yes_no) with incrimental values (1,2,3,...237). The result is a single variable, form.yes_no, to define. The plus side is the result is a list you can just search for the yeses (boxes that were checked). The minus side is the result is a list you have to search for the yeses. If each checkbox has a different name, you can loop through form fields with something like: #evaluate('form.' & field_name)# HTH, Sean -Original Message- From: Daniel Murphy [mailto:[EMAIL PROTECTED]] 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. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: 237 checkboxes
Optionally, you can name them all the same, assign them different values...any that are checked will have their values passed as a list. That way you only have 1 to worry about. > 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=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. > -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
RE: 237 checkboxes
Yes. You need to create your form and your checking via a loop. Anytime you have more than say 5 lines of something redundant I use a loop. No use wasting time hardcoding all that when you can make it changeable very quickly by just changing the loop parameters with possibly a variable you pass it or a query attribute. Look into CFLOOP's: no programmer in his right mind will write all that out without a loop. Michael W. Blair Web Applications Developer Canyon WebWorks An Arizona Internet LLC Company http://www.canyon.net [EMAIL PROTECTED] PHONE: (520) 773-9059 FAX: (520) 773-4945 -Original Message- From: Daniel Murphy [mailto:[EMAIL PROTECTED]] Sent: Wednesday, March 29, 2000 3:22 PM To: '[EMAIL PROTECTED]' Subject: 237 checkboxes 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=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
Re: 237 checkboxes
If you name each of the checkboxes the same (all name="survey_answer" or some such) and give each a different value (name="survey_answer" value="votedinelection" name="survey_answer" value="incomegreaterthan3") then you would get a comma delimited list of all the checked boxes coming through (survey_answer=votedinelect,incomegreaterthan3). You could then loop through this list and do updates. If you gave the checkboxes values identical to database fields and defaulted the values in the DB to 0 or NO, then you could construct the loop fairly simply: *insert blank record* UPDATE dbtable SET #answer# = 'YES' WHERE id = #id_from_previous_query# This will be easier to code than 237 ifs, but on the other hand it could potentially involve 237 updates instead of just one Insert. Efficiency will be determined by percentage of checkboxes likely to be checked. Hope this helps, Judah At 05:21 PM 3/29/00 -0500, you wrote: >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=lists&body=lists/cf_talk or >send a message to [EMAIL PROTECTED] with 'unsubscribe' in >the body. -- Archives: http://www.eGroups.com/list/cf-talk To Unsubscribe visit http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.
237 checkboxes
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=lists&body=lists/cf_talk or send a message to [EMAIL PROTECTED] with 'unsubscribe' in the body.