As I mentioned before, information is passed to the validation function in the event object, and in the code we see that the member ‘value’ is used to communicate the current value of the field.
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.
To start, we create a text field and bring up the properties dialog for the field.
Rating: 92 / 100
Overall: 90 Rates