How to Display an X After a Number in an Acrobat Form Field
Question details
The user needs to append a specific text character, such as an 'x', to the end of a numeric value in a PDF form field without breaking downstream calculations.

- Product
- Adobe Acrobat
- Device & OS
- not provided
- Scenario
- Setting up fillable PDF forms where certain input fields require a custom numeric suffix for display purposes.
- Observed behavior
- Adding letters directly into a numeric field converts the data to a text string, causing dependent calculation formulas to fail. A display-only formatting solution is required.
Ensure you have a PDF editing tool that supports custom JavaScript formatting for form fields, and verify that the target text field is set up to receive numeric input.
Apply a Custom JavaScript Format to the Form Field
Use a custom formatting script to visually append the 'x' suffix to the number while maintaining the underlying numeric value for calculations.
Unlike spreadsheet applications that use built-in format masks, PDF form fields rely on JavaScript for advanced display formatting. By using a custom format script, you can change how the value looks on the screen without altering the actual data used by other calculating fields.
Open your PDF document in Adobe Acrobat, navigate to the Tools menu, and select 'Prepare Form' to enable form editing.
Right-click the target text field where you want the suffix to appear and select 'Properties' from the context menu.
Navigate to the 'Format' tab within the Properties dialog box. Click the 'Select Format Category' dropdown menu and choose 'Custom'.
In the Custom Format Script text box, enter the following code: if (!event.willCommit) event.value = util.printf("%,0.0f", Number(event.value)) + " x";
Click 'Close' to save the properties. Exit form editing mode and type a number into the field to verify that the 'x' suffix is displayed correctly.

Create and Manage PDF Forms Easily with WPS Office
WPS Office features a powerful PDF editor that allows you to easily create, edit, and configure interactive fillable forms. You can format text fields, set up form properties, and handle interactive elements intuitively.
- 1. Open your PDF: Launch WPS Office and open your PDF document.
- 2. Navigate to the Form tab: Click on the 'Form' tab located on the top ribbon to access all interactive form tools.
- 3. Add or select a field: Use the 'Text Field' tool to draw a new input box, or click to select an existing field on your document.
- 4. Configure properties: Double-click the selected field to open its Properties dialog, where you can easily configure appearance, formatting, and behavioral settings.

Frequently Asked Questions
Can I add the 'x' before the number instead of after?
Yes. You can modify the custom format script to place the text string first. Change the script to read: event.value = "x" + util.printf("%,0.0f", Number(event.target.value)); in your custom formatting settings.
Why doesn't an Excel-style custom mask work in Acrobat?
PDF form fields utilize JavaScript for advanced data formatting and calculations. This environment operates differently from spreadsheet applications like Excel, which rely on built-in proprietary mask codes. Therefore, display modifications in PDFs generally require a short script.
Will adding text to a number field break my calculations?
If you manually type an 'x' into the field, it changes the data type to text and breaks calculations. However, if you use a custom formatting script, the script only alters the display value while keeping the underlying data strictly numeric, allowing other fields to calculate correctly.




