Try this:
<cfloop list="#thatListOfFields#" index="i">
<cfif not len(trim(form[i]))>
<!--- field is not empty --->
<cfelse>
<!--- field is empty --->
</cfif>
</cfloop>
It's worth noting that being empty isn't the same as being null - if
you insert an empty form field into a DB column, that column's value
will be an empty string, not a NULL value.
A quick way to do this is with the DB's NULLIF() function (your DB
probably supports it), like so:
INSERT INTO tablename (
fieldToBeFull
)
VALUES (
NULLIF(<cfqueryparam cfsqltype="cf_sql_varchar" value="#form.fieldname#">, '')
)
-joe
----- Original Message -----
From: Scott Stewart <[EMAIL PROTECTED]>
Date: Mon, 9 Aug 2004 14:31:00 -0400
Subject: determining Not Null in a list
To: CF-Talk <[EMAIL PROTECTED]>
All..
I have a list of form fields, of that list only the user indicated fields
will not be null.
Is there a way to loop through the list and determine which fields are not
null.
So that the field name and it's value can be written into a database
Thanks
sas
------------------------------------
Real Magnet
Scott Stewart
Web Application Developer
[EMAIL PROTECTED]
5039 Connecticut Ave. NW
Washington DC 20009
tel: 202-244-7845
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

