Skip to content

Miscellaneous

hasErrors()

hasErrors() — returns any

Returns true if the object has any errors. You can also limit to only check a specific property or name for errors.

NameTypeRequiredDefaultDescription
propertystringyesName of the property to check if there are any errors set on.
namestringyesError name to check if there are any errors set with.
hasErrors([ property, name ]) <!--- Check if the post object has any errors set on it --->
<cfif post.hasErrors()>
    <!--- Send user to a form to correct the errors... --->
</cfif>