Let see...so how would that be coded?
How do I validate the "entire" form as opposed to the typical technique
below?

<CFTRY>

     <CFIF Form.FirstName is "">

          <CFTHROW Type="AddError"
                       Message="Please enter your first name.">

     </CFIF>

     <CFIF Form.LastName is "">

          <CFTHROW Type="AddError"
                       Message="Please enter your last name.">

     </CFIF>

     <CFCatch Type="AddError"

     <CFOUTPUT>#CFCatch.Message#</CFOUTPUT>

</CFTRY>

Rick

  -----Original Message-----
  From: Adrocknaphobia [mailto:[EMAIL PROTECTED]
  Sent: Tuesday, June 22, 2004 8:55 PM
  To: CF-Talk
  Subject: Re: Is there a way to have all CFCatch messages display at once?

  Yeah, the array is the way to go. Validate the entire form and append
  each message to the array. Although rather than blast a user with all
  those errors, why not do something more subtle like highlight the
  invalid form fields with another color.

  -Adam

  ----- Original Message -----
  From: Rick Faircloth <[EMAIL PROTECTED]>
  Date: Tue, 22 Jun 2004 20:57:59 -0400
  Subject: Is there a way to have all CFCatch messages display at once?
  To: CF-Talk <[EMAIL PROTECTED]>

  Hi, all.

  I run my validation on forms by having a form submit back to the page it's
  on,
  then just use CF code validation (since I know little about _javascript_)
  and then, either showing a CFCatch error or processing the form
  successfully,
  then CFLocating to a confirmation page.

  This works fine for my rather limited validation needs, but it's annoying
  that
  a user has to receive one CFCatch error message a time.

  Is there some way, with the CFTRY / CFCATCH approach to validation,
  to have all the form fields validated and have the CFCATCH error messages
  grouped together in an array or something, then have them displayed all at
  once?

  i.e...

  > You must enter a first name.
  > You must enter a last name.
  > You must enter your age.

  etc., etc., etc...

  Ideas?

  Rick

  --
  Outgoing mail is certified Virus Free.
  Checked by AVG Anti-Virus (http://www.grisoft.com).
  Version: 7.0.251 / Virus Database: 263.3.3 - Release Date:
  6/18/2004________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings] [Donations and Support]

Reply via email to