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 actually....ok
ok....completley!)

> 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 000000001 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 = "Q"&NumberFormat(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=subscribe&forumid=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
                                

Reply via email to