Re: Sort #FORM# by value?

2004-05-20 Thread Morgan Senkal
It's working perfect Charlie, thanks.  One small change I made on the second line of the function: Changed: var stForm = f; Changed To: var stForm = Duplicate(f); I wanted to leave the original #form# intact for further processing.  On testing the code I found that leaving out the Duplicate() f

Re: Sort #FORM# by value?

2004-05-20 Thread Charlie Griefer
Morgan: This seems to do it:   function sortForm(f) {    var sortArray = arrayNew(2);    var stForm = f;        var keys = structKeyArray(stForm);    var sortedKeys = "";        for (i=1; i LTE #arrayLen(keys)#; i=i+1) {     if (NOT isNumeric(stForm[keys[i]])) {  structDelete(stForm,

Re: Sort #FORM# by value?

2004-05-20 Thread Morgan Senkal
le 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? > > >the cfdump I'm getting back for the FORM element: [Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Re: Sort #FORM# by value?

2004-05-20 Thread Charlie Griefer
ROTECTED]> 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)+

Re: Sort #FORM# by value?

2004-05-20 Thread Morgan Senkal
Doesn't matter, as long as I can access the name in relation to the value.  On second thought, I think the way I coded the form, I don't believe that it is possible for there to be repeat values.  (all the form values in question are from checkboxes, so I can control the values sent).  So actually

Re: Sort #FORM# by value?

2004-05-20 Thread Charlie Griefer
when you say you need to retain the original key name...how so?  a 2d array? a structure? Charlie - Original Message - From: "Morgan Senkal" <[EMAIL PROTECTED]> To: "CF-Talk" <[EMAIL PROTECTED]> Sent: Thursday, May 20, 2004 2:56 PM Subject: Re: Sort

Re: Sort #FORM# by value?

2004-05-20 Thread Morgan Senkal
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: ACTIONDATE1 

Re: Sort #FORM# by value?

2004-05-20 Thread Morgan Senkal
I suppose I should have given more information, sorry :-(  But to clarify:  I only want to pull out FORM values which are numeric and order those.  I also need to somehow retain the key name associated to each value.  It's a good start tho thanks much Charlie!  Perhaps you and I can fiddle with it

RE: Sort #FORM# by value?

2004-05-19 Thread Charlie Griefer
Hi Morgan: Might be a better/more efficient way, but threw together a quick UDF that seems to work: function sortForm(stForm) { var formValueArray = arrayNew(1); var kArray = structKeyArray(stForm); for (i=1; i LTE arrayLen(kArray); i=i+1) { formValueArray[arrayLen(form