hasErrors()
Description
Returns true if the object has any errors. You can also limit to only check a specific property and name for errors.
Function Syntax
hasErrors([ property, name ])
Parameters
| Parameter | Type | Required | Default | Description |
|---|---|---|---|---|
property |
string |
No | |
Name of the property to check if there are any errors set on. |
name |
string |
No | |
Error name to check if there are any errors set with. |
Examples
<!--- Check if the post object has any errors set on it --->
<cfif post.hasErrors()>
<!--- Send user to a form to correct the errors... --->
</cfif>
