Take a look at the CF_REUSEFORM tag.  If you use this tag in your display
template (your data entry screen) you can use the same display fuse for new
records, editing existing records, and reporting on validation failures.

In order to avoid losing the attributes from your form, you don't do a
cflocation to redirect on a failed validation, you simply do an include of
the display fuse.  That way the fuse will have access to all of the form
fields, which are now sitting in the attributes scope.

So, in your action fuse that processes the form, you do your validation
checks.  If they fail, you do a cfinclude of your display fuse (usually
after setting a variable that tells the display fuse to show an error
message).  If the validations don't fail, you do the rest of your processing
(e.g., add a record, update the database), and then cflocation to the next
fuseaction.

Bob

-----Original Message-----
From: Peter Froh [mailto:[EMAIL PROTECTED]]
Sent: March 28, 2001 4:01 PM
To: Fusebox
Subject: server side form validation


I am in the process of absorbing the Fusebox Methodology and I was wondering
how to handle server side form validation.

I tried to see how the "jazzloft" code did this in the shopping cart
curcuit, but it did not even use server side form validation, just client
side validation.

Do I need to submit the form to itself for validation and then use
cflocation to redirect user to a process fuse? How will that effect the
attributes scope?  Will I not lose the attribute values from the form?

I tried sending the form to another process page, but when it failed the
validation and I had to redirect users back to the form, the attributes
scope lost the form information.  So I tried session variables, it works but
all that locking, yuck!

There has to be a better way.

Any help would be appreciated.

Thanks.
Peter


Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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

Reply via email to