For the number of form fields use this instead:

ListLen( FORM.FieldNames )

Remember that when you use an image form input to submit the form two extra
fields will be sent (x and y coordinates of the mouse click). Also, unticked
checkboxes will not be counted in and fields with the same name (especially
radio buttons) will only be counted once.

Hope this helps

-----Original Message-----
From: Alex Skinner [mailto:[EMAIL PROTECTED]]
Sent: 09 August 2001 14:42
To: CF-Talk
Subject: RE: counting form fields


for the number of form fields

ListLen(Form.formfields)

for the query just put queryname.recordcount

Hope this helps

Alex#



-----Original Message-----
From: [EMAIL PROTECTED]
[mailto:[EMAIL PROTECTED]]On Behalf Of Michael
Wolter
Sent: 09 August 2001 14:34
To: CF-Talk
Subject: counting form fields


Is there any way to get a count of the number of fields that are returned
from a form?

Also, is there a way to get a count of the number of records selected by a
cfquery?  The only way I have found to do that is to do a second cfquery
and use the "count(*)" function, but that seems to be double the work.
In Visual Basic, I can just put ".recordcount" after the recordset name to
get a count.  Does Cold Fusion have anything like that?

Thanks!

-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=
|  Michael Wolter                             [EMAIL PROTECTED]   |
|  Administrative Programmer/Analyst          Carlisle, PA 17013     |
|  Dickinson College, Computer Services       (717) 245-1527         |
-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=

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
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.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