Here's a method I use and like.
I have my err_validateEvents.cfm (in my events circuit) check a bunch of
conditions. Any time it finds a failing condition is adds to a list of
failure messages called errMsg delimited with a "LI" tag (list item). Then
at the end if the error message variable is not blank, it adds the
necessary UL tags at the front and back, as well as a message the front
like "There were problems with your form submission:" or whatever. Then it
cfmodules the application itself and sends the error message,
fuseaction=#xfa.failValidation# and all the values from the form. After
that (but still inside the cfif) I have a cfabort. Then I have an if
around the call to the cfreuseform tag (in the add and edit fuseactions)
which doesn't call it if attributes.errmsg is not blank. I have
attributes.errmsg cfparam'ed to "" in my app_globals.cfm.
One modification to cfreuseform that I use -- i have it set variables for
my form in the attributes scope instead of the variables scope.
Then no extra page request and no messy variables on the url.
If you'd like an example (can't send attachments to this list) send me an
email.
At 08:24 AM 3/2/01 -0500, you wrote:
>Tim, go back and look at the Archives for recent discussions on
>cf_reuseform. You'll need to account for sending your form.xxxx variables
>from act_validateCode.cfm back to your display page either using URL
>variables on the cf_location, or packing them up into session or client
>variables, and then unpacking them into the Form structure prior to your
>call to cf_reuseform. Again, there should be some examples in the
>archives........
>
>Mike Pellicciotti
> > -----Original Message-----
> > From: Tim Price [SMTP:[EMAIL PROTECTED]]
> > Sent: Tuesday, February 27, 2001 8:23 PM
> > To: Fusebox
> > Subject: A simple question !
> >
> > Please forgive me for asking what will probably seem to all you gurus out
> > there a very simple question.
> >
> > I got hold of Steve Nelsons book in the UK a few weeks ago and have been
> > structuring my CF accordingly.
> >
> > However, I'm pulling my hair out trying to do some customised server side
> > validation on a form.
> >
> > My form, included when fuseaction="editCode" and which uses the
> > <cf_reuseform> tag, redirects back to the circuit index file with
> > fuseaction="validatCode" like so.
> >
> > <form action="index.cfm" method="post">
> > <input name="fuseAction" type="Hidden" value="validateCode">
> >
> >
> > Then the act_validateCode.cfm does some jigery pokery and depending on the
> > outcome
> > sets the following variables.
> >
> > If validation failed
> > attributes.displayaction = "Form"
> > attributes.fuseaction = "editCode"
> >
> > If validation OK
> > attributes.displayaction = ""
> > attributes.fuseaction = "updateCode"
> >
> > before a URL directs the flow back to the circuit index.cfm
> >
> > However, if the validation failed I cant get the information entered by
> > the
> > user to re-display using <cf_reuseform> !!!!!!!!!
> >
> > I know the answers out there.
> > Thanx in advance.
> >
> > Tim
> >
> > PS. Has anyone ever thought of coming over to the UK to do some Fusebox
> > trainning ?
> >
> >
> >
> >
> >
> >
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists