Collecting data using an input form is very common, but it also makes sense to consider applying Validation to any input fields which have specialised formats (e.g. an email address). Validation makes sure your data is accurate and appropriate for your needs, and can lead to real benefits for an organisation, such as more specialised and focused reporting, which in turn can drive improvements in targets and forecasts.
Vizlib Input Form contains a Validation function, which helps you apply conditions to a data field quickly, edit these conditions as your requirements change, and even specify instructions and an error message to help with entering the correct value. We're going to using the Review Date field from the Layout Wizard article as an example.
Before we use the Validation menu, there are some settings we need to configure in the Type panel (Figure 1).
- Check the Review Date is set to a Date data type.
- Select a Display date format from the dropdown - we're going to use 02/17/2016, so any date entered into this field should have the format MM/DD/YYYY.
Figure 1: Validation Type Panel
Validation settings are held in the Validation panel (Figure 2). Follow the instructions here to set validation for the input field.
- Slide the Required toggle from No to Yes to show the Validation panel.
- Enter an Error Message if you need one. This will be displayed whenever an incorrect value is held in the field.
- Enter some text in the Required label field if you need it. We're going to enter MM/DD/YYYY which confirms the correct date format to enter.
Figure 2: Validation Conditions
The Review Date input field should now display validation results.
If you enter text that complies with the validation condition, the error will disappear (Figure 3).
Figure 3: Validation Success
If you enter a date which isn't in the valid format, the error message will be displayed. (Figure 4).
Figure 4: Validation Error
You can find a list of related articles in the Vizlib Input Form Overview.