Sorting a form collection?
Is it possible to sort a collection, particularly the form collection?? All my form fields are created dynamically and are named such as Q1 Q2 Q3 Q4 .. .. Q10 Q11 Etc. When I loop the collection they are returned in the good old alphabetical order i.e. Q10 Q11 Q12 Q13 Q9 Q8 I just wanted to know if there was easy way to do this before I started building it to create a list, removing the Q and sorting chronologically then looping that. especially since the collection has the potential to get rather large. Also, I didn't want to put 0's in front of single digit numbers since they are unique ID's of rows in my database table. So, is there a function to sort a collection like you can with lists using listsort() ? or evenis there a way to make access use 01, 02 when auto incrementing with an autonumber datatype? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
Something like this : cfloop collection=form item=ii cfif find(ii,Q) cfset NumberOfQs = NumberOfQs + 1 /cfif /cfloop cfloop from=1 to=NumberOfQs index=i cfset currntQ = Q i do what ever... /cfloop or use NumberFormat to name your field like 001 002 003 ... 010 011 WG -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 13:23 To: CF-Talk Subject: Sorting a form collection? Is it possible to sort a collection, particularly the form collection?? All my form fields are created dynamically and are named such as Q1 Q2 Q3 Q4 .. .. Q10 Q11 Etc. When I loop the collection they are returned in the good old alphabetical order i.e. Q10 Q11 Q12 Q13 Q9 Q8 I just wanted to know if there was easy way to do this before I started building it to create a list, removing the Q and sorting chronologically then looping that. especially since the collection has the potential to get rather large. Also, I didn't want to put 0's in front of single digit numbers since they are unique ID's of rows in my database table. So, is there a function to sort a collection like you can with lists using listsort() ? or evenis there a way to make access use 01, 02 when auto incrementing with an autonumber datatype? ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
Ewok, Also, I didn't want to put 0's in front of single digit numbers since they are unique ID's of rows in my database table. Use number format when you append your numbers to the form field names eg. name=Q#NumberFormat(i,00)# This will make sure that your numbers are zero filled. So, is there a function to sort a collection like you can with lists using listsort() ? You could do a listsort on form.fieldnames, then loop through that to process your form fields. eg. cfscript sortedlist = listsort(form.fieldnames); for (i=1;i=ListLen(sortedList);i=i+1) { thisfield = ListGetAt(sortedList,i); WriteOutput(form[thisfield]); } /cfscript Hope this helps Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
I can think of a number of workarounds, i was just wondering if there was a built in function to accomplish the sorting changing the format may be a good solution though... allthough it would change the number 1 to 01... that number would not match up with the uniqueid in the database anymore... I guess i would just need to reformat it when comparing it to the database with something like numberformat(numb, 0) ??? the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions thanks for the response ! - Original Message - From: Stephen Moretti [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 8:42 AM Subject: Re: Sorting a form collection? Ewok, Also, I didn't want to put 0's in front of single digit numbers since they are unique ID's of rows in my database table. Use number format when you append your numbers to the form field names eg. name=Q#NumberFormat(i,00)# This will make sure that your numbers are zero filled. So, is there a function to sort a collection like you can with lists using listsort() ? You could do a listsort on form.fieldnames, then loop through that to process your form fields. eg. cfscript sortedlist = listsort(form.fieldnames); for (i=1;i=ListLen(sortedList);i=i+1) { thisfield = ListGetAt(sortedList,i); WriteOutput(form[thisfield]); } /cfscript Hope this helps Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
it's a small furry Teddy Bear type animal indigenous to the forest moon of Endor. d'uh -Original Message- From: John Stanley [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:26 To: CF-Talk Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
Depending on how you look at it, it's either a short wookiee or a very large gerbil. - Jim -Original Message- From: John Stanley [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 8:26 AM To: CF-Talk Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
Of course, of course... But I thought it was referring to an acronym, and I was asking for a definition there grumpy -Original Message- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:25 AM To: CF-Talk Subject: RE: Sorting a form collection? it's a small furry Teddy Bear type animal indigenous to the forest moon of Endor. d'uh -Original Message- From: John Stanley [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:26 To: CF-Talk Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. Yes, that's exactly what I am doing. I wrote it originally creating a dynamic table each time a survey was created. to hold results for each survey and it worked great .as long as I entered all the data to build the new survey heh : ) there was just too much room for error that way to let joe blow create a new survey so im changing it around some (quite a bit actuallyok okcompletley!) It would only have problems differenciating between the two if you are storing the number in a text/char field. it is an autonumber datatype I had no idea that SQL would match 0001 to 1 that's deffinatley good news! I should be set now thanks alot for your help! - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
:-) its a posters handle. -Original Message- From: John Stanley [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:37 To: CF-Talk Subject: RE: Sorting a form collection? Of course, of course... But I thought it was referring to an acronym, and I was asking for a definition there grumpy -Original Message- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:25 AM To: CF-Talk Subject: RE: Sorting a form collection? it's a small furry Teddy Bear type animal indigenous to the forest moon of Endor. d'uh -Original Message- From: John Stanley [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:26 To: CF-Talk Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
What is Ewok? Whats a John? ;) you mean besides character's from the greatest movie of all time of course?!!? http://www.openfusion.com.au/labs/ewok/ - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what y ou need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
Sorry, all. I didnt know there was a user named Ewok. -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:40 AM To: CF-Talk Subject: Re: Sorting a form collection? Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. Yes, that's exactly what I am doing. I wrote it originally creating a dynamic table each time a survey was created. to hold results for each survey and it worked great .as long as I entered all the data to build the new survey heh : ) there was just too much room for error that way to let joe blow create a new survey so im changing it around some (quite a bit actuallyok okcompletley!) It would only have problems differenciating between the two if you are storing the number in a text/char field. it is an autonumber datatype I had no idea that SQL would match 0001 to 1 that's deffinatley good news! I should be set now thanks alot for your help! - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
HAHA!! gj - Original Message - From: Robertson-Ravo, Neil (RX) [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:25 AM Subject: RE: Sorting a form collection? it's a small furry Teddy Bear type animal indigenous to the forest moon of Endor. d'uh -Original Message- From: John Stanley [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:26 To: CF-Talk Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
Lucas lawsuit :-) -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:44 To: CF-Talk Subject: Re: Sorting a form collection? What is Ewok? Whats a John? ;) you mean besides character's from the greatest movie of all time of course?!!? http://www.openfusion.com.au/labs/ewok/ - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what y ou need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
There were no Ewok's in Army of Darkness -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:44 AM To: CF-Talk Subject: Re: Sorting a form collection? What is Ewok? Whats a John? ;) you mean besides character's from the greatest movie of all time of course?!!? http://www.openfusion.com.au/labs/ewok/ - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what y ou need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
You mean the third movie was the best? Or was it the 7th? -Original Message- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 8:45 AM To: CF-Talk Subject: RE: Sorting a form collection? Lucas lawsuit :-) -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:44 To: CF-Talk Subject: Re: Sorting a form collection? What is Ewok? Whats a John? ;) you mean besides character's from the greatest movie of all time of course?!!? http://www.openfusion.com.au/labs/ewok/ - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what y ou need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
thanksappreciate that lol its ok though, i didnt know there was a user named John Stanley ill change it to The User Formerly Known as Ewok to avoid any future confusion heh - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:44 AM Subject: RE: Sorting a form collection? Sorry, all. I didnt know there was a user named Ewok. -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:40 AM To: CF-Talk Subject: Re: Sorting a form collection? Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. Yes, that's exactly what I am doing. I wrote it originally creating a dynamic table each time a survey was created. to hold results for each survey and it worked great .as long as I entered all the data to build the new survey heh : ) there was just too much room for error that way to let joe blow create a new survey so im changing it around some (quite a bit actuallyok okcompletley!) It would only have problems differenciating between the two if you are storing the number in a text/char field. it is an autonumber datatype I had no idea that SQL would match 0001 to 1 that's deffinatley good news! I should be set now thanks alot for your help! - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what you need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Your ad could be here. Monies from ads go to support these lists and provide more resources for the community. http://www.fusionauthority.com/ads.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
eAt 09:50 AM 03/07/03 -0500, John Stanley wrote: There were no Ewok's in Army of Darkness But it would have been cool if there had been. I'd have loved to see them meet the boomstick. :) T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
No, but that was only the second best trilogy ever!! - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:50 AM Subject: RE: Sorting a form collection? There were no Ewok's in Army of Darkness -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:44 AM To: CF-Talk Subject: Re: Sorting a form collection? What is Ewok? Whats a John? ;) you mean besides character's from the greatest movie of all time of course?!!? http://www.openfusion.com.au/labs/ewok/ - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what y ou need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ewok-Talk was Sorting a form collection?
ok now we are dragging it off of the off-topic topic that was never on topic : ) you think Michael would change the title to Ewok-Talk? should probably kill this soon : ) p.s there weren't 7, aren't 7, never will be 7 - Original Message - From: Mark A. Kruger - CFG [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 10:03 AM Subject: RE: Sorting a form collection? You mean the third movie was the best? Or was it the 7th? -Original Message- From: Robertson-Ravo, Neil (RX) [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 8:45 AM To: CF-Talk Subject: RE: Sorting a form collection? Lucas lawsuit :-) -Original Message- From: Ewok [mailto:[EMAIL PROTECTED] Sent: 07 March 2003 14:44 To: CF-Talk Subject: Re: Sorting a form collection? What is Ewok? Whats a John? ;) you mean besides character's from the greatest movie of all time of course?!!? http://www.openfusion.com.au/labs/ewok/ - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:26 AM Subject: RE: Sorting a form collection? What is Ewok? -Original Message- From: Stephen Moretti [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 9:28 AM To: CF-Talk Subject: Re: Sorting a form collection? Ewok, I guess i would just need to reformat it when comparing it to the database with something like No need... You can give SQL the number 1 and it will still find 1 in the database. It would only have problems differenciating between the two if you are storing the number in a text/char field. the list wouldnt work since all the form fields are radio buttons and some will not exist if they werent selected, I can keep them all alive through dynamic cfparams on the action page which would keep all fields in the collection...but form.fieldnames would only hold fields that were selected before the form was submitted i COULD move the params to the top of the form i suppose but like i said...the list could potentially get very large so I'd rather stay away from too many list functions Hmmm Guessing here I'm assuming that your doing something like a survey with a number of questions, hence the form field names Q1, Q2,... Qn and that you are storing only the number as a number and not Q in the database. If you're using a query to generate the form on the previous page and ordering your questions correctly on that page, then you can use the same query to get a list of the question numbers in the correct order on your action page. To process the existing answers on your action page what y ou need to do is something like this : cfquery name=QuestionQRY SELECT QuestionNumber FROM QuestionTable ORDER BY QuestionNumber /cfquery cfset QuestionList = valuelist(QuestionQRY.questionnumber) cfloop list=#QuestionList# index=QNo cfset thisfield = QNumberFormat(QNo,00) cfif IsDefined(form[thisfield]) !--- Process a question where I have an answer --- cfelse !--- Do what ever you need to when a question isn't answered --- /cfif /cfloop Hope this makes sense and helps. Regards Stephen = CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Ewok-Talk was Sorting a form collection?
~lmao~ tears streaming down my face here ok now we are dragging it off of the off-topic topic that was never on topic : ) you think Michael would change the title to Ewok-Talk? should probably kill this soon : ) p.s there weren't 7, aren't 7, never will be 7 There's 9 episode actually, but whether we'll get to see the last three ~shrug~ But you are right... enough is enough. Michael will be killing the thread if it goes on any more and I don't blame him Good fun friday email though... Thanks guys... Stephen and his blatent CF-Europe advertising. CF-Europe http://www.cf-europe.org/ Olymia Conference Centre, London 29-30 May 2003 Keynote by Ben Forta and Tim Buntel Discount tickets before March 14th 2003 ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Signup for the Fusion Authority news alert and keep up with the latest news in ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
RE: Sorting a form collection?
Ash: All right you furry little bastards, listen up. This is my BOOMstick. Ewok 1: Grk meep bimp lopo Ash: All right she-bitch cock's rifle Ash: Let's go -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 10:03 AM To: CF-Talk Subject: RE: Sorting a form collection? eAt 09:50 AM 03/07/03 -0500, John Stanley wrote: There were no Ewok's in Army of Darkness But it would have been cool if there had been. I'd have loved to see them meet the boomstick. :) T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
yeah sure...you saw the trouble he had with all the mini evil ashes. a few dozen ewoks would give him a run for his money with some rocks and sticks : ) - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 10:28 AM Subject: RE: Sorting a form collection? Ash: All right you furry little bastards, listen up. This is my BOOMstick. Ewok 1: Grk meep bimp lopo Ash: All right she-bitch cock's rifle Ash: Let's go -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 10:03 AM To: CF-Talk Subject: RE: Sorting a form collection? eAt 09:50 AM 03/07/03 -0500, John Stanley wrote: There were no Ewok's in Army of Darkness But it would have been cool if there had been. I'd have loved to see them meet the boomstick. :) T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Structure your ColdFusion code with Fusebox. Get the official book at http://www.fusionauthority.com/bkinfo.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
Re: Sorting a form collection?
ok, here's a peace offering/bribe... http://www.deadites.net/ 3rd article, click the mirror link if you havent seen Return to the Woods yet...its a riot lol some really great aspiring actors/actresses in there ***that was sarcasm*** When I saw Bruce Campbell at his last book signing in Chapel Hill NC, some girl kept asking him to say Gimmee some sugar baby Cmon! you GOTTA say, Gimmee some sugar baby. Bruce said, IM NOT YOUR DAMN MONKEY! lol... I love that guy ...he never said gimmee some sugar baby; ) and they all lived happily ever after...except the girl everyone was laughing at : ) The End - Original Message - From: John Stanley [EMAIL PROTECTED] To: CF-Talk [EMAIL PROTECTED] Sent: Friday, March 07, 2003 10:28 AM Subject: RE: Sorting a form collection? Ash: All right you furry little bastards, listen up. This is my BOOMstick. Ewok 1: Grk meep bimp lopo Ash: All right she-bitch cock's rifle Ash: Let's go -Original Message- From: Thane Sherrington [mailto:[EMAIL PROTECTED] Sent: Friday, March 07, 2003 10:03 AM To: CF-Talk Subject: RE: Sorting a form collection? eAt 09:50 AM 03/07/03 -0500, John Stanley wrote: There were no Ewok's in Army of Darkness But it would have been cool if there had been. I'd have loved to see them meet the boomstick. :) T ~| Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4 Subscription: http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribeforumid=4 FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Get the mailserver that powers this list at http://www.coolfusion.com Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4