I've been there , read the book, seen the film and got the t-shirt !
After hours of pulling my hair out I consulted GurusRUs on here and they
advised me to include the form page if the validation failed rather than
trying to cflocate back to it and loosing all the form scope !
Hope this short example explains this for you.
A bit of background act_valPage.cfm page sets a list of field names that
failed validation and the frm_page.cfm uses this to listFind on the input
fields and display an error if its contained in the list.

        <cfcase value="editPage">
                <cfset valErrList="">
                <cfinclude template="frm_page.cfm">
        </cfcase>

        <cfcase value="savePage">
                <cfinclude template="act_valPage.cfm">
                <cfif len(valErrList) GT 0>
                        <cfset attributes.displayaction="Form">
                        <cfinclude template="frm_page.cfm">
                <cfelse>
                        <cfinclude template="act_updPage.cfm">
                        <cflocation url="index.cfm?fuseaction=listPages&#urltoken#">
                </cfif>
        </cfcase>

Tim Price
Paceway Solutions Ltd (UK)


-----Original Message-----
From: Peter Froh [mailto:[EMAIL PROTECTED]]
Sent: 28 March 2001 13:01
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