PDF Editing Issues

Add Line Breaks Between Names in an Acrobat Form Field

Nimra MalikNimra Malik Nov 19, 2026 869 views

Question details

Display names from multiple Acrobat form fields on separate lines in a calculated text field.

Add Line Breaks Between Names in an Acrobat Form Field
Product
Adobe Acrobat
Device & OS
not provided
Scenario
A form uses JavaScript to combine names from multiple fields into one destination field.
Observed behavior
The desired result is a destination field that shows each name on its own line.
Before you start

Open the PDF in a version of Adobe Acrobat that supports editing forms, and identify the source field names and destination text field. You will need to edit the destination field's properties and calculation script.

Solution 1Recommended

Use a JavaScript newline in a multiline Acrobat text field

Use this method when a calculated form field combines names and should display each one on a separate line.

For example, a custom calculation script can use event.value = this.getField("Name1").valueAsString + "\n" + this.getField("Name2").valueAsString;. Replace Name1 and Name2 with the actual source field names.

1
Open the form editor

In Adobe Acrobat, open the PDF and select Prepare a Form from the tools menu.

2
Enable multiline text

Open the destination text field's Properties, select the Options tab, and check Multi-line. Make the field tall enough to show the expected number of names.

3
Edit the calculation

In the field's Properties, open the Calculate tab, select Custom calculation script, and click Edit. Replace the space separator between names with "\n", or use ", \n" if you also want a comma.

4
Test the form

Close the field properties, use Preview in Prepare a Form, and enter names in the source fields. Confirm that the destination field displays each name on a separate line.

Use a JavaScript newline in a multiline Acrobat text field
Check the field height: If a name is not visible, enlarge the destination field or adjust its text size in Properties. A newline alone will not make a single-line field display multiple lines.
Free Microsoft Office alternative

Work with PDFs and Office files in WPS Office

WPS Office is a free, lightweight Office alternative with a familiar interface for working with documents and PDFs. Its format support makes it easy to move existing Office files; however, it does not fix an Acrobat calculation script or guarantee support for Acrobat form JavaScript.

Open and work with PDF documents alongside Office filesCompatible with Microsoft Office formats such as DOCX, XLSX, and PPTXUse a familiar interface to move between documents and spreadsheetsAccess free tools in a lightweight Office suite
microsoft office alternative - wps office

Frequently Asked Questions

What JavaScript character puts the next name on a new line?

Use the newline escape sequence "\n" between the field values. Use ", \n" instead if you want a comma before the line break.

Why are the names still on one line?

In Prepare a Form, open the destination field's Properties and check Multi-line on the Options tab. Also check that the calculation script uses "\n" rather than a space.

Where do I edit the form calculation script?

In Acrobat, select Prepare a Form, open the destination field's Properties, and go to Calculate. Select Custom calculation script and click Edit.

How do I show more than two names?

Add each source field to the calculation with "\n" between values, using its actual field name. Enlarge the destination field so the additional lines are visible.