if you want it to insert only numeric values...the UDF should look like:

<cfscript>
function sortForm(stForm) {
  var formValueArray = arrayNew(1);
  var kArray = structKeyArray(stForm);

  for (i=1; i LTE arrayLen(kArray); i=i+1) {
   if (isNumeric(stForm[kArray[i]])) {
    formValueArray[arrayLen(formValueArray)+1] = stForm[kArray[i]];
   }
   }

  temp = arraySort(formValueArray, 'numeric');
  return formValueArray;
}
</cfscript>

this does NOT yet retain the form field name.  still not sure how you intend
to handle that.
----- Original Message -----
From: "Morgan Senkal" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, May 20, 2004 3:00 PM
Subject: Re: Sort #FORM# by value?

> Ok, for starters I tried adding a simple if statement like so:
>
> 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:
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to