Let’s take a look at how to do that with a text field that is only supposed to have a value of either ‘AAAA’ or ‘BBBB’ (yes, I know that this does not make much sense in a real PDF form).
So, if the user enters ‘01234’ we should see an error message that would instruct the user about what type of data is valid for this field.
For example, a textbox ‘Other’ needs to be filled only when ‘Other’ radio option is selected.
Here is how to add a condition to a validation: There is an optional 4th parameter to the add Validation() function.
If you pass a condition, that condition will be checked before running the validation.
Example: is a handy function included in gen_validatorv4script that can be used to check the ‘checked’ status of radio group or check box.
To start, we create a text field and bring up the properties dialog for the field.
When using Textbox questions, often times you'll want to validate the data your respondents enter.
It makes analyzing, reporting and then acting on your data easier when it all conforms to certain formatting.
If you want to show all the error messages together, then just call the Enable Msgs Together() function as shown below.
Sometimes it may be required to validate certain fields only on certain conditions.
You can also apply formatting validation to a textbox question after the fact on the Validation tab.