After the “Edit” button is clicked, a new window will open that allows us to edit the new script: This script also includes a check for an empty string, so that the user can wipe out a wrong string and start from scratch.
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.
If the parameter is a valid postcode, the function returns it correctly formatted - i.e.
in uppercase and with a space between the inward part and the output parts.
below is the code for validating mobile number with enter only numeric, length must be 10 digits and restrict user to entering illegal characters.
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).
Similarly if we want to validate phone number like xxx-xxx-xxxx format then you can use “\d-\d-\d”.
If you want to use regular expression for validating phone or mobile numbers followed by country code.
With our Email verifier you can determine up to 95 % of non working Email addresses.
One of the questions I get asked again and again is how to validate a field value in an Acro Form with a custom validation script.