Return to v1.4.5 docs

validateOnUpdate()



Registers method(s) that should be called to validate existing objects before they are updated.

Name Type Required Default Description
methods string No See documentation for validate.
condition string No See documentation for validatesConfirmationOf.
unless string No See documentation for validatesConfirmationOf.
<cffunction name="init">
	<cfscript>
		// Register the `check` method below to be called to validate existing objects before they are updated
		validateOnUpdate("checkPhoneNumber");
	</cfscript>
</cffunction>

<cffunction name="checkPhoneNumber">
	<cfscript>
		// Make sure area code is `614`
		return Left(this.phoneNumber, 3) == "614";
	</cfscript>
</cffunction>