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. Jim Davis > -----Original Message----- > From: Kwang Suh [mailto:[EMAIL PROTECTED] > Sent: Friday, June 27, 2003 7:36 PM > To: CF-Talk > Subject: Re: Smart or Stupid (CFLOOP as a GOTO) > > Why not use the condition attribute? > > <cfloop condition="theForm eq valid"> > > ----- Original Message ----- > From: "Jim Davis" <[EMAIL PROTECTED]> > To: "CF-Talk" <[EMAIL PROTECTED]> > Sent: Friday, June 27, 2003 5:26 PM > Subject: Smart or Stupid (CFLOOP as a GOTO) > > > > This may be a VERY dumb question, but I'm brain fried. > > > > Okay - so I'm working on a form and I need to validate fields for many > > things. Taking "email address" for example I need to validate that it's > > been filled in (not zero length), that it's less than 255 characters > (the > > database limit), that it fits a email format and finally that the email > > address isn't already in use. > > > > What I'd like to be able to do is check through all these validations. > The > > instant a problem is found I want to stop checking. I would then > redisplay > > the form and so forth. > > > > In a custom tag or function I might, when an error is found simply > "return" > > to the caller with the error information. Since this is a rather small > set > > and is only the first of many small forms I decided (perhaps wrongly) to > > just do the validation at the top of the page. > > > > To simulate a components ability to return at any point I wrapped the > whole > > validation block in a CFLOOP from 1 to 1 (1 iteration) - as soon as I > hit > an > > error (and set the error variable) I CFBREAK. Right after the loop I > check > > the value of the error variable. > > > > Now that I'm looking at it I'm not sure... is this just the stupidest > thing > > you're ever heard? Should I take the extra time and create a customized > > validation custom tag for each and every form? > > > > Jim Davis > > > > > ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| 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