what i do is similar, except that i don't want to duplicate the stuff in 
the editdept fuseaction in the savedept fuseaction, so at the end of the 
err template and before the template that saves to the db, i check the 
length of my error message and if it is not 0, i cfmodule the editdept 
fuseaction passing all the form variables and the error message.  in the 
editdept fuseaction i have an if around the reuseform tag call b/c my forms 
accept attributes params and that's how they're sent by the cfmodule, so i 
don't need to run reuseform.


   <cfcase value="add">
         <cfset xfa.submit="contacts.insert">
         <cfset request.page.tabhighlight="add">
         <cfset request.page.subheaderimage="addanewcontact">
         <cfset request.page.resetButton=1>
     <cfinclude 
template="#request.path.cf_queries#qry_offices_Departments_get.cfm">
     <cfif attributes.msg_type is not "error">
         <cfmodule template="#request.path.cf_customtags#reuseform.cfm" 
action="new" 
fieldlist="contact_id,honorofic,first_name,last_name,title,email,phone,phone_ext,office_id,department_id,display_honorofic;1,display_first_name;1,display_last_name;1,display_title;1,display_email;1,display_phone;1,display_phone_ext;1,active;1">
     </cfif>
     <cfinclude template="dsp_contacts_edit.cfm">
   </cfcase>

   <cfcase value="insert">
         <cfset xfa.failedValidation="contacts.add">
     <cfinclude template="err_contacts_edit.cfm">
     <cfinclude template="act_contacts_insert.cfm">
         <cflocation 
url="#request.self#?fuseaction=contacts.add&msg=#urlencodedformat("The 
Contact you entered has been recorded.")#&msg_class=msg_success">
   </cfcase>

At 09:37 AM 4/11/01 -0700, you wrote:
>When the user submits the form with the save fuseaction, execute an err_
>template before you execute and template that performs the action. If there
>are errors, call the frm_ template instead.
>
>                 <!--- save the department --->
>                 <cfcase value="savedept">
>                     <cfinclude template="err_department.cfm">
>                     <cfinclude template="err_holidays.cfm">
>                     <cfif len(error) GT 0 OR len(details) GT 0 OR
>len(holidayProblem) GT 0>
>                         <cfinclude template="qry_getrequestitems.cfm">
>                         <cfset attributes.fa = "form">
>                         <cfinclude template="frm_department.cfm">
>                     <cfelse>
>                         <cfinclude template="cud_department.cfm">
>                         <cfinclude template="cud_holidays.cfm">
>                         <!--- refresh the Holidays query --->
>                         <cfset attributes.refresh = 1>
>                         <cfinclude
>template="../queries/qry_getholidays.cfm">
>                         <cflocation
>url="index.cfm?fa=thanksdept&deptid=#attributes.deptID#">
>                     </cfif>
>                 </cfcase>
>
>---
>Jeffrey B. Marsh
>Professionals built the Titanic.
>Amateurs built the Ark.
>
>-----Original Message-----
>From: Dian Oktosoma [mailto:[EMAIL PROTECTED]]
>Sent: Tuesday, April 10, 2001 2:13 AM
>To: Fusebox
>Subject: Server side validation
>
>Is there any examples that shows how to create server side validation
>using fusebox (reuse forms)?
>
>thanks
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
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