Whatever message this page gives is out now! Go check it out!

Validating data

Last update:
May 18, 2026
It is often not sufficient that input data merely exists; it must also have the right format. For example, a date field must have data in a date format. A salary field must have data in a numeric or currency format. There are many ways to ensure the validity of data, including the following methods:
  • Use the cfparam tag with the type attribute to validate a variable.
  • Use the IsValid function to validate a variable.
  • Use the cfqueryparam tag in a SQL WHERE clause to validate query parameters.
  • Use cfform controls that have validation attributes.
  • Use a form input tag with a hidden attribute to validate the contents of a form input field.
Note:
Data validation using the cfparam, cfqueryparam, and form tags is done by the server. Validation using cfform tags and hidden fields is done using JavaScript in the user's browser, before any data is sent to the server.
For detailed information on validating data in forms and variables, see Validating data For detailed information on validating query parameters, see Using cfqueryparam in Enhancing security with cfqueryparam.

Share this page

Was this page helpful?
We're glad. Tell us how this page helped.
We're sorry. Can you tell us what didn't work for you?
Thank you for your feedback. Your response will help improve this page.

On this page