Other PDF Issues

How to Format and Validate a MAC Address in a PDF Form

Olivia MillerOlivia Miller Oct 28, 2026 869 views

Question details

The user needs to set up a text field in a PDF form to format input as a MAC address with separators and validate that it only contains valid hexadecimal characters.

Product
Adobe Acrobat
Device & OS
not provided
Scenario
Creating or editing an interactive PDF form and ensuring users enter correctly formatted network MAC addresses.
Observed behavior
The user needs a method to enforce a 12-character hexadecimal format (with hyphens or colons) using either format masks or custom validation scripts.
Before you start

Ensure you have your PDF opened in form-editing mode (such as 'Prepare Form' in Acrobat) and have access to the Text Field Properties dialog.

Solution 1Recommended

Use an Arbitrary Mask for Display Formatting

Set a predefined format mask to automatically insert hyphens as the user types the MAC address.

This is the simplest method to ensure the entered characters are visually separated into the standard MAC address layout. However, it does not restrict the input to strictly hexadecimal characters.

1
Open Field Properties

Right-click the target text field in your PDF form and select 'Properties' from the context menu.

2
Navigate to the Format Tab

Click on the 'Format' tab at the top of the Properties dialog box.

3
Select Special Format

Click the 'Select format category' dropdown menu and choose 'Special'.

4
Apply Arbitrary Mask

Select 'Arbitrary Mask' and enter 'XX-XX-XX-XX-XX-XX' into the mask field. Click 'Close' to save your changes.

Use an Arbitrary Mask for Display Formatting
Format Limitation: The 'X' character in an arbitrary mask allows most standard characters. To restrict input strictly to numbers and letters A-F, you will also need a validation script.

Manage and Fill PDF Forms Easily with WPS Office

WPS Office includes a comprehensive PDF editor that lets you view, fill, and manage interactive PDF forms seamlessly. Whether you are dealing with text fields, dropdowns, or validated formats, WPS PDF ensures a smooth user experience.

  1. 1. Install WPS Office: Download and install the free WPS Office suite on your device.
  2. 2. Open Your PDF: Launch WPS PDF and open the interactive PDF form you need to fill.
  3. 3. Fill and Save: Click into the text fields to enter your data. The software will respect standard field formatting. Save your completed document securely.
Fully compatible with standard interactive PDF forms and formatsLightweight, fast, and feature-rich PDF viewer and editorCross-platform support allowing you to fill forms on Windows, Mac, and mobile
microsoft office alternative - wps office

Frequently Asked Questions

Why does my arbitrary mask not stop non-hexadecimal characters?

An arbitrary mask in PDF forms only dictates the structural format (like inserting hyphens). The 'X' placeholder accepts any standard alphanumeric character. To strictly enforce hexadecimal characters (0-9 and A-F), you must add a custom JavaScript validation script.

Can I use colons instead of hyphens for the MAC address format?

Yes. To display colons, change your arbitrary mask in the Format tab to 'XX:XX:XX:XX:XX:XX'. The provided JavaScript regular expression already validates both hyphens and colons as acceptable separators.

Where do I find the text field properties to add these formats?

You need to be in form editing mode. In Acrobat, open the 'Prepare Form' tool, right-click the specific text field you want to modify, and select 'Properties' from the drop-down menu to access the Format and Validate tabs.