Milks:
    If you really want to do it as you said and JavaScript is not an option
you can do this.
1. Place your form in a template that is cfincluded into the original
template.
2. CFParam all the form variables like so
<cfparam name="form.Firstname" default="">
and in all your form elements in the value field set the
value="#form.FirstName#"
For select boxes, radio buttons and such you'll have to do a bit more
conditional logic but essentially the same concept.
3.  When the form is posted on the template it is posted to do your
validation and if you find invalid input somewhere just display the error
message and then cfinclude the template with the form in it again.  Because
all your form elements have value="#form.whatever#" in them already they'll
be populated with the data that was just entered.

Hope that helps.


Andrew Hewitt
Web Application Developer
webworld studios inc.


----- Original Message -----
From: "Milks, Jim" <[EMAIL PROTECTED]>
To: <[EMAIL PROTECTED]>
Sent: Tuesday, August 15, 2000 9:25 AM
Subject: Advanced error handling


> I usually use JavaScript that is triggered by the submit button. This way
it
> is validated on the client side, and doesn't waste a trip to the server.
You
> could also use CFFORM elements, which generates the JS for you, but I find
> them clunky, and prefer to write my own.
>
> If however you wish to highlight the text that is missing or something
like
> that, you need to check for it in the called page, then return the user to
> the calling page with a custom error message, and with conditional logic,
> change the font colours and so on. If you choose this option, you should
> also catch all of the form values in session variables and repopulate the
> original form with the values they entered so they don't have to re-enter
> everything, which really turns users off.
>
> Good luck.
>
> JM
>
> --------------------------------------------------------------------------
----
> Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
> To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or
send a message to [EMAIL PROTECTED] with 'unsubscribe' in
the body.
>

------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/cf-talk@houseoffusion.com/
To Unsubscribe visit 
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a 
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.

Reply via email to