A small point which applies to any user input form - it's best to design it so it can handle both initial input (so the form starts empty) and correction of errors (so the form displays the previous inputs). So:
* the display page looks for values returned for reinput
* the action page checks the input and, if errors found re-invokes the display page and passes it the inout values plus error message(s).
N.B. To do this you must use <cfoutput> to build the form.
For example in Iminmei's log-in page:
<!--- LOGIN DISPLAY PAGE --->
<!--- Defaults in case this is the first time --->
<cfparam name="URL.ErrorMsg" default="">
<cfparam name="URL.UserId" default="">
<cfparam name="URL.Password" default="">
<!--- Check for error message --->
<cfif URL.ErrorMsg NEQ "">
<cfoutput>
#URL.ErrorMsg #
</cfoutput>
</cfif>
<!--- Initialise form from arguments received --->
<cfoutput>
<form action="login_action.cfm" method="post">
UserId<input type="text" name="UserId" value="#URL.UserId#"><br>
Password<input type="password" name="Password" value="#URL.Password#"><br>
<input type="submit" value="Submit">
</form>
</cfoutput>
<!--- LOGIN ACTION PAGE --->
<cfquery name="CheckUser" db="mydb">
select * from Users
where UserID='#form.UserId#'
and Password='#form.Password#'
</cfquery>
<cfif CheckUser.RecordCount>
<cfset session.authenticated=1>
<cflocation url="userstart.cfm" addtoken="yes">
<cfelse>
<!--- Return the inputs as URL parameters. --->
<cfset RedisplayLogin = "login_display.cfm?ErrorMsg=You have input your user information incorrectly, please hit the back button and try again&UserId=#form.UserId#&Password=#form.Password#">
<cflocation url="#RedisplayLogin#">
</cfif>
There are other ways to manage the communication between the dispay page and the action page. Fusebox is becoming very popular - see
[sig][/sig]