if (isNumeric(kArray[1]))
{
formValueArray[arrayLen(formValueArray)+1] = stForm[kArray[i]];
}
But apparently it doesn't recognize any of the values as numbers. This is the cfdump I'm getting back for the FORM element:
ACTIONDATE1
ACTIONDATE2
ACTIONITEMDESCRIPTION
ACTIVITYTYPE
ACTIVITYTYPEORDER 5
BUSINESSUNIT
BUSINESSUNITORDER 3
DATE1 5/13/2004
DATE2 5/20/2004
FIELD1 foo
FIELD2 bar
FIELD3 foobar
FIELD4 barfoo
FIELDNAMES ISSUEDESCRIPTIONORDER,ISSUEDESCRIPTION,ISSUEOUTCOME,ACTIONITEMDESCRIPTION,GENTEXT,ACTIVITYTYPEORDER,ACTIVITYTYPE,DATE1,DATE2,TRIBEORDER,TRIBE,BUSINESSUNITORDER,BUSINESSUNIT,PARTICIPANT,ISSUECATEGORY,PRIORITY,PROJECTORDER,PROJECT,ISSUESTATUSORDER,ISSUESTATUS,ACTIONDATE1,ACTIONDATE2,QUERYNUMBER,QUERYTITLE,QUERY0
GENTEXT
ISSUECATEGORY
ISSUEDESCRIPTION
ISSUEDESCRIPTIONORDER 9
ISSUEOUTCOME
ISSUESTATUS
ISSUESTATUSORDER 10
PARTICIPANT
PRIORITY
PROJECT
PROJECTORDER 4
QUERY0 Run Query
QUERYNUMBER 0
QUERYTITLE Custom Query
TRIBE
TRIBEORDER 1
So there are indeed numbers in there, but the question of whether they are 'numeric' objects is apparently no. Not sure the best way to proceed at this point...
>Hi Morgan:
>
>Might be a better/more efficient way, but threw together a quick UDF
>that seems to work:
>
><html>
><head>
> <title></title>
> <meta http-equiv="Content-Type" content="text/html;
>charset=iso-8859-1" />
>
> <cfscript>
> function sortForm(stForm) {
> var formValueArray = arrayNew(1);
> var kArray = structKeyArray(stForm);
>
> for (i=1; i LTE arrayLen(kArray); i=i+1) {
>
>formValueArray[arrayLen(formValueArray)+1] = stForm[kArray[i]];
> }
>
> temp = arraySort(formValueArray, 'text');
> return formValueArray;
> }
> </cfscript>
></head>
>
><body>
>
><cfparam name="form.field1" default="foo">
><cfparam name="form.field2" default="bar">
><cfparam name="form.field3" default="foobar">
><cfparam name="form.field4" default="barfoo">
>
><cfdump var="#form#">
>
><cfset formValueArray = sortForm(form)>
>
><cfdump var="#formValueArray#">
>
></body>
></html>
>
>Hope that helps.
>
>-----Original Message-----
>From: Morgan Senkal [mailto:[EMAIL PROTECTED]
>Sent: Wednesday, May 19, 2004 12:41 PM
>To: CF-Talk
>Subject: Sort #FORM# by value?
>
>
>Any ideas? You would think that StructSort would be the answer but
>nope.
>
>TIA!
>
>-Morgan
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

