Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations wOOdy-Soft on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Loop form fields for email / Don't send NULL

Status
Not open for further replies.

DeZiner

Programmer
May 17, 2001
815
US
Hi All,

I'm using:
<cfloop index=&quot;fname&quot; list=&quot;#form.fieldnames#&quot;>
#fname#: #Evaluate(&quot;form.&quot; & fname)#<br>
</cfloop>

As a simple form handler. What I am looking to do is to NOT SEND (print in email) those name/value pairs that don't have a value.

I know fname is there always. What I can't seem to figure is how to check if form. & fname is NULL. can you advise on proper syntax.

Thanks Much

DeZiner
Never be afraid to try something new.
Remember that amateurs built the Ark.
Professionals built the Titanic
 
fname will only be there for form fields that are actually submitted (for example, an unchecked checkbox isn't submitted)

text fields will not be null, they'll be empty

use the Len() fontion to test for zero length


rudy
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top