Back
validatesFormatOf()
Validates that the value of the specified property is formatted correctly by matching it against a regular expression using the regEx argument and / or against a built-in CFML validation type using the type argument (creditcard, date, email, etc.).
// Make sure that the user has entered a correct credit card validatesFormatOf(property="cc", type="creditcard"); /* * Make sure that the user has entered an email address ending with the * `.se` domain when the `ipCheck()` method returns `true`, and it's not * Sunday. Also supply a custom error message that overrides the CFWheels * default one */ validatesFormatOf( property="email", regEx="^.*@.*\.se$", condition="ipCheck()", unless="DayOfWeek() eq 1" message="Sorry, you must have a Swedish email address to use this website." );
Copied!