James Birchler wrote:

> 1. Client side: Could someone please show me an example of doing client-side
> form validation that doesn't use the alertbox method? It would be nice if
> next to the input field the user would simply see red text explaining their
> input error.
>

   It depends what you mean by validation.  I once set up a credit card field to wipe 
out spaces and weird
characters (I.E. '-') so that only the 16 digit number remained.  No alert box, and 
that could constitute
validation.  However, it just does it, the user doesn't see anything telling them I 
just did it.


> 2. Server side: How about server-side validation using CFFORM with the same
> kind of output--is there an easy way to re-display the original form fields
> with error messages where applicable and keeping/displaying the form entries
> the user has properly entered?

  I don't use CFFORM, but I like server-side validation.  I think there is an easy way 
to re-display the original
form fields, w/ error message were applicable.  But, it can be tedious to code.  Add a 
'verify information' page,
that has code similar to this:

<CFIF form.myfield is "">
    Warning you didn't enter myfield.  Please do so.
    <INPUt type="text" name="myfield">
<CFELSE>
   Myfield: <CFOUTPUT>#myfield#
    <INPUt type="hidden" name="myfield" value="#myfield#>
  </CFOUTPUT>
</CFIF>

for each field.  Resubmit the form back onto itself until they are no more errors.  If 
no errors, continue to your
processing page.

--
Jeff Houser | mailto:[EMAIL PROTECTED]
AIM: Reboog711  | ICQ: 5246969 | Phone: 860-229-2781
--
Instant ColdFusion 4.5  | ISBN: 0-07-213238-8
Due out 3rd Quarter 2001
--
DotComIt, LLC
database driven web data using ColdFusion, Lotus Notes/Domino
--
Half of the Alternative Folk Duo called Far Cry Fly
http://www.farcryfly.com | http://www.mp3.com/FarCryFly
--
I've got the brains, you've got the looks, let's make lots of money


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to