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 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
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
                                

Reply via email to