cfparam

Overview ColdFusion Open BlueDragon Lucee

Used to check if a variable exists, and validates its type and value. If the specified variable doesn't exist a default value can also be supplied at this point.

Available: Yes
End Tag: Yes
Attribute Collection: No
Allows any Attribute: No

Attributes

Name Required Type Default Description
default No A value to be applied to this parameter if it does not exist at the time of this check.
max No The maximum value this parameter should have, only used when TYPE = "range". This is a required attribute when TYPE = "range".
min No The minimum value this parameter should have, only used when TYPE = "range". This is a required attribute when TYPE = "range".
name Yes Provide a name for the parameter to be checked.
pattern No A javascript regex pattern this parameter should conform to, only used when TYPE = "regex" or "regular_expression". This is a required attribute when TYPE = "regex" or "regular_expression".
type No By providing a data type to validate the expected parameter (e.g. QUERY, STRUCT), an error will be thrown if the wrong type is passed in. Other type options include "range", "regex" or "regular_expression" to validate the value of a parameter.