I'm new to this forum so I hope this isn't an old topic, but would be
interested to hear different approaches to form validation.  I have tried
looking into the archives on this subject, but haven't found too much...

I have spent a lot of time working on a system to keep the form validation
as seperate from the action files that actually save/update the form input
as possible.  It seems to me that to promote modularity, form validation has
to be generic enough that the action file that saves the input could be used
by different forms.

For example, say I have an admin form which posts to
fuseaction=adminformsave and a regular user form that posts to
fuseaction=formsave.  If the action of saving each form's info is the same,
I would want to reuse the same action file.  However, if I want to add some
type of form validation, I would NOT want to include that in the
act_formsave.cfm, or at least not include any redirections back to a form in
that file.   Instead I would need some other module or some other way to
handle it to keep it modular.  I would think this would be an important
emphasis when writing action files, in order to insure modularity.
Comments?  Suggestions?

<cfcase value="adminFormSave">
        <cfinclude template="act_formSave.cfm">
        <cfinclude template="act_logAdminAction">
        <cflocation url="index.cfm?fuseaction=adminGoodJob">
</cfcase>

<cfcase value"formSave">
        <cfinclude template="act_formSave.cfm">
        <cflocation url="index.cfm?fuseaction=goodJob">
</cfcase>

Reid Hankins


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