When you "send the user back to the form" you could simply cfinclude the form template. That is: if you haven't already output some visuals. IMO it's the elegant way.
I see you are placing all the data in session variables. If you used cfinclude instead of cflocation you wouldn't need to do this. I'm not recommending you go and start over, of course. So given your situation, I'd do as James said and make a Session.ErrorMessagesList. (I personally use two lists: one with error msgs, and one with the error fields. Then I can list the error msgs at the top of the form, and highlight the error fields.) Then you'd go <cfif Len(Session.ErrorMessagesList)><cflocation....></cfif> Make sense? > -----Original Message----- > From: Mark Leder [mailto:[EMAIL PROTECTED]] > Sent: lundi 1 juillet 2002 17:52 > To: CF-Talk > Subject: RE: Aggregating server side form validation messages > > > I guess I don't understand your response. My validation page is a > separate CFInclude, so when someone click submit on the form > page, they > are sent to the form summary page. At the top of the summary > page is an > include to update the Session structure, then an include to do the > validation. If all validation passes, then the remainder of > the summary > is displayed, if not, the end user is sent back to the form to make > corrections. > > Thanks, > Mark > > > -----Original Message----- > From: Matthew Walker [mailto:[EMAIL PROTECTED]] > Sent: Monday, July 01, 2002 1:07 AM > To: CF-Talk > Subject: RE: Aggregating server side form validation messages > > > Why use cflocation at all? Why not simply cfinclude the form template? > > > -----Original Message----- > > From: Mark Leder [mailto:[EMAIL PROTECTED]] > > Sent: lundi 1 juillet 2002 16:57 > > To: CF-Talk > > Subject: Aggregating server side form validation messages > > > > > > I'm doing both client side (JS) and server-side form validation. > > Typically in JS Client side, if there are a number of > required fields > > not filled in by the user, upon submit, a single popup alert occurs > > listing all the fields that need to be filled in. > > > > I want to do this same process with server side (using CFM) > > as well. In > > other words, using a first name field as an example, I'd like > > to replace > > the CFLOCATION statements in each check group (I could wind > up with 30 > > checks on the various field) with something that will "remember" the > > #val# number and then lump them all one CFLOCATION statement > > at the end > > of the validation routine, such as: > > > > <CFLOCATION > > URL="#REQUEST.webroot##REQUEST.Ssubwebroot#/default.cfm?pID=#U > > RL.pID#&va > > l=19a, 19b, etc." ADDTOKEN="No"> > > > > The &val= appendage would be dynamic, only having those > > values which did > > not pass the server-side validation. > > > > How would I accomplish something like this? > > > > ============================================== > > > > <!--- First Name ---> > > <!--- Check that the field is required, 19a ---> > > <CFLOCK SCOPE="SESSION" TIMEOUT="10" TYPE="READONLY"> > > <CFIF SESSION.ecom.firstname IS ""> > > <CFLOCATION > > URL="#REQUEST.webroot##REQUEST.Ssubwebroot#/default.cfm?pID=#U > > RL.pID#&va > > l=19a" ADDTOKEN="No"> > > </CFIF> > > </CFLOCK> > > > > <!--- Check that the field has only alphabetical > characters, 19b > > ---> > > <CFLOCK SCOPE="SESSION" TIMEOUT="10" TYPE="READONLY"> > > <CFSET VARIABLES.testFirstName = > > #IsAlphabet(SESSION.ecom.firstname)#> > > </CFLOCK> > > <CFIF VARIABLES.testFirstName IS "No"> > > <CFLOCATION > > URL="#REQUEST.webroot##REQUEST.Ssubwebroot#/default.cfm?pID=#U > > RL.pID#&va > > l=19b" ADDTOKEN="No"> > > </CFIF> > > > > > > =============================================== > > > > Thanks, > > Mark > > > > > > ______________________________________________________________________ This list and all House of Fusion resources hosted by CFHosting.com. The place for dependable ColdFusion Hosting. FAQ: http://www.thenetprofits.co.uk/coldfusion/faq Archives: http://www.mail-archive.com/[email protected]/ Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

