Javascript can work miracles here...

use JS to populate a hidden form field on submit.

function checkQty( theForm ){   
// check all QUANTITY fields
        for( k=0; k<theForm.elements.length; k++ ){

                if( fieldName.indexOf("quantity") >= 0 ){
                        fieldValue = "0" + theForm.elements[k].value;
                        if( parseInt(fieldValue) > 0 )
                                theForm.hidIDs.value += "," +
theForm.elements[k].name;
                }
        }
}

You may want to use JS to parse out the actual item ID if you are so
inclined.  Anyway, you'll get a hidden field [hidIDs] passed to the
processing page containing a comma-delimited list of the items that had a
QTY greater than 0.

+-----------------------------------------------+
Bryan Love
  Macromedia Certified Professional
  Internet Application Developer
  Database Analyst
Telecommunication Systems
[EMAIL PROTECTED]
+-----------------------------------------------+

"...'If there must be trouble, let it be in my day, that my child may have
peace'..."
        - Thomas Paine, The American Crisis



-----Original Message-----
From: Jason Miller [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, May 28, 2002 12:58 PM
To: CF-Talk
Subject: Dynamically Processing Form Values


Hello all. New to the list - Hope someone can help me. Of course time is
somewhat urgent on this.

I have a lengthy form page. It is created through 5 cfqueries for eachmain
subject. The entire page is a form. I have javascript arrays that populate a
summary area on the fly when someone enteres a quantity.

Each product has a unique identifiers....product0 - product"i" - whatever
the recordcount is.
So another words - it loops through all records.. starting with "product0"
and currently ending in "product79"
Each product has about 4 form values I need to process..
So product0 - has itemqty0, itemdesc0, itemname0 and so on.
BUT I ONLY want products that have itemQty ( quantity) that is GT 0 to
display.With 79 products - each with 4 pieces of information - that becomes
316 of #FORM.Product0#
#FORM.ItemQty0# and so on.

The latest thing I tried was very straightforward.. except too straigh
forward.. do not know how to interject and only spit out the variabls with
itemqty
of GTE 1

                   <CFLOOP COLLECTION="#form#" ITEM="myfield">
                           #variables.myfield# : #form[myfield]#
                   </CFLOOP>
In my head it seems o straightforward.. but whatever I have tried does not
produce the right results.

So to recap my request. I have over 300 form values on the form page. On the
Form Process page - I wish to spit back out ONLY those that have a value in
the qty field of 0 or better.

Whatever I attempt I am unable to get this to work - seems like it should be
so simple. Any help is GREATLY appreciated.
Thanks,
Jason Miller

______________________________________________________________________
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to