Try something like this:

<cfparam name="field1" default="">
<cfparam name="field2" default="">
<cfparam name="field3" default="">
<cfparam name="field4" default="">
<cfparam name="go" default="">
<cfparam name="missingfields" default="">

<cfoutput>
<form action="#script_name#" method="post">
<input type="hidden" name="go" value="yes">
<input type="text" name="field1" size="10"><br>
<input type="text" name="field2" size="10"><br>
<input type="text" name="field3" size="10"><br>
<input type="text" name="field4" size="10"><br>
<input type="submit">
</form>
</cfoutput>
<br>
<br>

<cfif go neq "">


<cfset requiredfields = "field1,field2,field3,field4">

<!--- Check for missing fields --->
<cfloop list="#requiredfields#" index="rfields">
<cfif evaluate(#rfields#) is "" or evaluate(#rfields#) is "none">
<cfset errorflag="yes">
<cfset missingfields="#missingfields#<LI>#replace(rfields,"_"," ","all")#">
</cfif>
</cfloop>

<cfoutput>#missingfields#</cfoutput>

</cfif>

--------------------------------------------------------------
Mark Warrick
Phone: (714) 547-5386
Efax.com Fax: (801) 730-7289
Personal Email: [EMAIL PROTECTED]
Personal URL: http://www.warrick.net 
Business Email: [EMAIL PROTECTED]
Business URL: http://www.fusioneers.com
ICQ: 346566
--------------------------------------------------------------


> -----Original Message-----
> From: Peter Benoit [mailto:[EMAIL PROTECTED]]
> Sent: Tuesday, September 19, 2000 6:51 AM
> To: '[EMAIL PROTECTED]'
> Subject: [CF-Talk] Form Submission
> 
> 
> I want to email the results of a rather large form to someone.  I can't
> verify that all the form fields have been filled out prior to the 
> submission
> (no client side scripting allowed), so how can I do this without a huge
> number of :
> 
> <cfif IsDefined('form.whatever')>#form.whatever#</cfif>
> 
> I end up typing this over and over for each form field.  Is there a better
> way of doing this?
> 
> Thanks,
> Peter
> 
> ------------------------------------------------------------------
> ------------
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit 
> http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf
> _talk or send a message to [EMAIL PROTECTED] with 
> 'unsubscribe' in the body.

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebarRsts&bodyRsts/cf_talk or send a message 
to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to