PDF Editing Issues

Preserve Phone Number Formatting in Adobe Acrobat Form Fields

Amos GikundaAmos Gikunda Nov 19, 2026 868 views

Question details

Format a phone number consistently when combining its value with text in another PDF form field.

Preserve Phone Number Formatting in Adobe Acrobat Form Fields
Product
Adobe Acrobat PDF forms
Device & OS
not provided
Scenario
A calculated text field includes a phone number entered in another PDF form field.
Observed behavior
The phone number's displayed format may not carry over when its value is inserted into the destination field.
Before you start

Open the PDF in a version of Adobe Acrobat that can edit form fields, and check the exact name of the phone number field. The example below expects a 10-digit phone number and a destination text field.

Solution 1Recommended

Format the phone number with an Acrobat calculation script

Use a custom calculation script when the destination field must combine a phone number with a sentence.

The script reads the source field as a string and applies the pattern 999 999-9999 before adding it to the destination field. Adjust the pattern and sentence to suit your form.

1
Open the form editor

Open the PDF in Adobe Acrobat and select Tools > Prepare Form, or find Prepare a Form under All tools.

2
Check the source field name

Open the phone number field's Properties and check its name on the General tab. The example uses Phone Number; replace that name in the script if yours is different.

3
Add a calculation script

Open the destination text field's Properties, select the Calculate tab, choose Custom calculation script, and click Edit. Enter: var f = this.getField("Phone Number"); var nFormat = util.printx("999 999-9999", f.valueAsString); if (f.value) event.value = "If you have any questions, please do not hesitate to call me at " + nFormat + "."; else event.value = "";

4
Save and test the form

Confirm the script, close field Properties, and save the PDF. Enter a 10-digit number in Phone Number and move to another field to check the calculated sentence; clear the number to check that the destination field becomes blank.

Format the phone number with an Acrobat calculation script
Check the number pattern: The example is intended for a 10-digit number without a country code. Use a different pattern and test it if the form accepts country codes or other number lengths.
Free Microsoft Office alternative

Work with PDFs and Office documents in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for working with PDFs and common Office documents. It can help you move between existing files, but it does not replace Acrobat's custom form calculation scripting.

Open and work with PDF documents alongside Office filesCompatible with Microsoft Word, Excel, and PowerPoint formats, including DOCX, XLSX, and PPTXFamiliar interface for moving from Microsoft OfficeFree, lightweight suite for everyday document tasks
microsoft office alternative - wps office

Frequently Asked Questions

Why does the phone number lose its display format in the combined field?

A field's display formatting may not carry over when its value is inserted into another field. In the destination field's Calculate script, read valueAsString and use util.printx to apply the desired pattern.

Where do I enter the calculation script in Acrobat?

In Prepare Form, open the destination text field's Properties. On the Calculate tab, select Custom calculation script and click Edit.

How do I change the phone number format?

Change the pattern in util.printx, such as replacing "999 999-9999" with "(999) 999-9999". Test the form with the number lengths and country codes your users will enter.

Will the calculated field work in every PDF viewer?

Not necessarily. PDF viewers differ in their support for Acrobat JavaScript and form calculations. Test the saved form in the viewer your recipients will use, and check whether JavaScript is enabled.