PDF Editing Issues

How to Format Number Combs with Hyphens in PDF Forms

Aamir Naveed AkramAamir Naveed Akram Nov 24, 2026 869 views

Question details

The user needs to align characters with visual hyphens or dashes in PDF form fields, typically for entering formatted data like Social Security Numbers or credit cards.

How to Format Number Combs with Hyphens in PDF Forms
Product
PDF Editor
Device & OS
not provided
Scenario
Designing an interactive PDF form where text fields must align perfectly with pre-printed background hyphens.
Observed behavior
Standard character comb properties distribute characters evenly but do not align around background hyphens, causing visual overlap and formatting misalignment.
Before you start

Make sure you have access to a PDF editor with advanced form field creation features, and verify exactly how many characters and hyphens your form layout requires.

Solution 1Recommended

Use a Single Text Field with Custom JavaScript

This is the most efficient method, utilizing a single text box that automatically formats the input with dashes as the user types.

Instead of relying on the standard comb feature, you can use a single field combined with custom formatting. This prevents alignment errors when placing text over background dashes.

1
Add a text field

Draw a single text field that covers the entire data entry area, including the space where the hyphens will appear.

2
Disable the comb setting

Open the Field Properties, navigate to the Options tab, and ensure the 'Comb' setting is unchecked.

3
Apply a custom format script

Go to the Format tab, choose 'Custom' as the format category, and enter a JavaScript snippet that automatically inserts a hyphen after every defined set of characters (e.g., every 4 digits).

Use a Single Text Field with Custom JavaScript
User Experience: This method offers a smoother experience for the end-user since they don't have to manually type the hyphens or jump between different form fields.
Easy PDF Form Management

Design Interactive PDF Forms with WPS Office

WPS Office provides robust and intuitive PDF form editing tools. You can easily create, position, and customize text fields with precise formatting properties to build professional PDF documents.

  1. 1. Open your document: Launch WPS Office and open your PDF file using the built-in PDF editor.
  2. 2. Access form tools: Navigate to the Form tab on the top ribbon to view all interactive form controls.
  3. 3. Insert text fields: Select the Text Field tool and draw it exactly where you need user input on the document.
  4. 4. Customize properties: Right-click the new text field, choose Properties, and customize the layout, font size, and character limitations.
Easily customize text field formats and character limits.Supports adding and managing interactive PDF form controls seamlessly.Fully compatible with standard Adobe PDF formats and layouts.Lightweight, fast, and features a familiar user-friendly interface.
QA img-9

Frequently Asked Questions

Why does the standard comb setting fail to align with background hyphens?

The character comb property evenly distributes characters across the total width of the text field. It does not account for irregular spacing caused by background text, symbols, or hyphens, leading to visual overlap.

Can I set a maximum character limit when using custom formatting scripts?

Yes. You can still specify a maximum character limit in the field's options tab to ensure users don't exceed the required length, even when formatting scripts are actively adding hyphens.

How do I make the cursor automatically jump to the next box when using separate text fields?

To automatically shift focus to the next field when the character limit is reached, you need to add a custom keystroke JavaScript to the field properties that triggers the focus shift.