How to Use Multiple Phone Number Formats in an Acrobat PDF Form
Question details
The user needs a single Acrobat PDF form field to support various international phone number formats for mobile and company numbers of varying lengths.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Designing an interactive PDF form where users need to enter international phone numbers, requiring proper formatting validation.
- Observed behavior
- Automatic formatting fails or causes ambiguity because the same number of digits can match multiple different formatting patterns (e.g., (+XX) XXXX-XXX XXX vs (+XX) XXX-XX XXX XX).
Before applying custom scripts, determine if it is strictly necessary to use a single field. Using separate fields for different phone number types is often more reliable than complex formatting scripts.
Use Separate Fields or a Dropdown Selector
Eliminate format ambiguity by separating mobile and landline inputs or using a dropdown to specify the desired format.
Because scripts cannot guess the intended format based solely on digit count, providing explicit options ensures the correct formatting pattern is applied.
Add distinct text fields in your PDF form labeled specifically as 'Mobile Number' and 'Landline Number' to avoid overlapping formats.
Alternatively, insert a dropdown menu or checkbox next to a single phone number field allowing the user to select their country or number type.
Write a custom format script in the text field properties that checks the value of the dropdown selection, identifies the prefix and length, and applies the corresponding pattern.

Restrict Input Using a Custom Keystroke Script
Use a custom JavaScript keystroke script to allow only valid phone number characters such as digits, spaces, periods, and the plus sign.
Easily Create and Edit Interactive PDF Forms with WPS Office
WPS Office provides a highly capable PDF editor that allows you to intuitively insert text fields, checkboxes, and dropdown menus to manage user inputs without needing complex JavaScript debugging.
- 1. Open your PDF document: Launch WPS Office and open the PDF file you wish to turn into an interactive form.
- 2. Access the Form tools: Navigate to the 'Form' tab in the top menu to access the interactive field creation tools.
- 3. Insert Form Fields: Click on 'Text Field', 'Check Box', or 'Combo Box' and draw the field directly onto your document to create dedicated input spaces.
- 4. Adjust Properties: Double-click the inserted field to open the properties panel, where you can modify field names, set character limits, and configure formatting.

Frequently Asked Questions
Can Adobe Acrobat automatically format any international phone number?
No, automatic formatting becomes ambiguous if different international patterns share the same number of digits. To ensure correct formatting, you must use separate fields or a dropdown selector to explicitly specify the country or number type.
How do I restrict phone number input to digits and the plus sign in a PDF form?
You can add a Custom Keystroke Script in the text field properties under the Format tab. Using a JavaScript regex, you can restrict the input to only allow digits, spaces, periods, and the plus sign.
Why is my PDF form phone number script not working?
Ensure that your custom JavaScript is placed in the correct section (e.g., Keystroke script vs. Format script) and that there are no conflicting validation rules applied to the same text field.
Can I use WPS Office to create interactive PDF forms?
Yes, WPS Office includes a robust PDF editor that allows you to easily add text fields, checkboxes, dropdowns, and other interactive elements to create fully functional and highly compatible PDF forms.




