----- Original Message -----
From: "Jim Davis" <[EMAIL PROTECTED]>
> That's only checked (as far as I understand it) before each iteration, not
> throughout the processing.
>
> In other words setting "theform" equal to "invalid" will not stop
processing
> immediately - it will finish out the rest of the code in the loop THEN
stop.
What about using a cftry/catch block?
Put a cftry around it (forget the loop entirely). When you encounter a
validation issue, cfthrow with your error message. Then, in the cfcatch, do
what you need to do when you want to stop the processing.
<cftry>
<cfif emailIsInvalid>
<cfthrow type="myValidation" message="The e-mail address is
invalid.">
</cfif>
<cfcatch type="myValidation">
<cfoutput>
#cfcatch.message#
</cfoutput>
<cfabort>
</cfcatch>
</cftry>
-------------------------------------------
Scott Brady
http://www.scottbrady.net
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription:
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Get the mailserver that powers this list at
http://www.coolfusion.com
Unsubscribe:
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4