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]

Reply via email to