Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <cfset errors = arrayNew(1)>
- <cfset showform = true>
- <cfparam name="form.name" default="">
- <cfif structKeyExists(form, "submit")>
- <cfif not len(trim(form.name))>
- <cfset arrayAppend(errors, "Enter a name")>
- </cfif>
- <cfif not arrayLen(errors)>
- <!--- store result to db, or email it, whatever --->
- <cfset showform = false>
- </cfif>
- </cfif>
- <cfif showform>
- <cfif arrayLen(errors)>
- <p>
- <b>Please fix these errors:</b><br/>
- <cfloop index="e" array="#errors#">
- <cfoutput>#e#<br></cfoutput>
- </cfloop>
- </p>
- </cfif>
- <form method="post">
- <cfoutput>
- enter your name : <input type="text" name="name" value="#form.name#"><br/>
- </cfoutput>
- <input type="submit" name="submit">
- </form>
- <cfelse>
- Thanks!
- </cfif>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement