Data validation lets you control data that is entered into an application by ensuring that the data conforms to specific type or formatting rules. Validation techniques have the following features:
ColdFusion provides several techniques to ensure that data is valid. These include techniques for validating form data and for validating ColdFusion variables. They also include techniques for validating form data before the user submits it to ColdFusion, or on the ColdFusion server.
When you design data validation you consider the following factors:
The validation technique: Whether to validate on the client's browser or on the server, and the specific server- or client-side validation technique, such as whether to validate when a field loses focus or when the user submits the form.
The validation type: The specific method that you use to validate the data, including the rules that you apply to test the data validity, such as testing for a valid telephone number.
The following sections describe the ColdFusion validation techniques and provide information on selecting a technique that is appropriate for your application. They also describe the validation types that ColdFusion supports. Later sections describe particular techniques in detail.